update pvlog
This commit is contained in:
@@ -88,6 +88,10 @@ in
|
|||||||
"domain" = "yt.home.arpa";
|
"domain" = "yt.home.arpa";
|
||||||
"answer" = ip;
|
"answer" = ip;
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
"domain" = "pvlog.home.arpa";
|
||||||
|
"answer" = ip;
|
||||||
|
}
|
||||||
{
|
{
|
||||||
"domain" = "nextcloud.home.arpa";
|
"domain" = "nextcloud.home.arpa";
|
||||||
"answer" = wireguardIp;
|
"answer" = wireguardIp;
|
||||||
|
|||||||
@@ -27,6 +27,16 @@ in
|
|||||||
default = "/";
|
default = "/";
|
||||||
description = "Location under which the data logger is reachable";
|
description = "Location under which the data logger is reachable";
|
||||||
};
|
};
|
||||||
|
fqdn = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "pvlog.home.arpa";
|
||||||
|
description = "FQDN under which the data logger is reachable";
|
||||||
|
};
|
||||||
|
useStepCa = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = true;
|
||||||
|
description = "Use step-ca for ACME certificates";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -38,6 +48,22 @@ in
|
|||||||
group = "kop-pvlog";
|
group = "kop-pvlog";
|
||||||
};
|
};
|
||||||
users.groups.kop-pvlog = { };
|
users.groups.kop-pvlog = { };
|
||||||
|
security.acme.certs."${cfg.fqdn}" = lib.mkIf cfg.useStepCa {
|
||||||
|
server = "https://127.0.0.1:8443/acme/kop-acme/directory";
|
||||||
|
};
|
||||||
|
services.nginx.virtualHosts."${cfg.fqdn}" = {
|
||||||
|
forceSSL = true;
|
||||||
|
enableACME = true;
|
||||||
|
quic = true;
|
||||||
|
http3 = true;
|
||||||
|
locations."/".proxyPass = "http://127.0.0.1:${builtins.toString cfg.port}";
|
||||||
|
locations."/".extraConfig = ''
|
||||||
|
more_clear_headers 'x-frame-options';
|
||||||
|
add_header Access-Control-Allow-Origin *;
|
||||||
|
add_header Access-Control-Allow-Methods "GET, POST, OPTIONS";
|
||||||
|
add_header Access-Control-Allow-Headers "Authorization, Origin, X-Requested-With, Content-Type, Accept";
|
||||||
|
'';
|
||||||
|
};
|
||||||
systemd.services.kop-pvlog = {
|
systemd.services.kop-pvlog = {
|
||||||
description = "Fronius data logger";
|
description = "Fronius data logger";
|
||||||
wants = [ "network-online.target" ];
|
wants = [ "network-online.target" ];
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ buildGoModule rec {
|
|||||||
src = fetchGit {
|
src = fetchGit {
|
||||||
url = "gitolite@kopatz.dev:kop-pvlog.git";
|
url = "gitolite@kopatz.dev:kop-pvlog.git";
|
||||||
ref = "master";
|
ref = "master";
|
||||||
rev = "23828dfa1275aac2b31e16b5e3cfb452d56aeae6";
|
rev = "2bb67c4b27bba9b99cf2182f989a53bb7f346659";
|
||||||
};
|
};
|
||||||
vendorHash = "sha256-8wYERVt3PIsKkarkwPu8Zy/Sdx43P6g2lz2xRfvTZ2E=";
|
vendorHash = "sha256-8wYERVt3PIsKkarkwPu8Zy/Sdx43P6g2lz2xRfvTZ2E=";
|
||||||
|
|
||||||
|
|||||||
20
pkgs/kop-pvlog/update.sh
Executable file
20
pkgs/kop-pvlog/update.sh
Executable file
@@ -0,0 +1,20 @@
|
|||||||
|
#!/usr/bin/env nix-shell
|
||||||
|
#!nix-shell -i bash -p jq nix-prefetch-git
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
PACKAGE_FILE="default.nix" # Replace with your package file path
|
||||||
|
REPO_URL="gitolite@kopatz.dev:kop-pvlog.git" # Replace with the repository URL
|
||||||
|
|
||||||
|
echo "Fetching latest revision from $REPO_URL..."
|
||||||
|
|
||||||
|
# Get the latest revision and sha256
|
||||||
|
latest_rev=$(nix-prefetch-git $REPO_URL | jq -r '.rev')
|
||||||
|
|
||||||
|
echo "Latest revision: $latest_rev"
|
||||||
|
|
||||||
|
# Update the package file with the new revision and sha256
|
||||||
|
sed -i "s|rev = \".*\";|rev = \"$latest_rev\";|" $PACKAGE_FILE
|
||||||
|
|
||||||
|
echo "Package file $PACKAGE_FILE updated successfully."
|
||||||
|
|
||||||
Reference in New Issue
Block a user