Show running Gateway commit and available updates

This commit is contained in:
jhartworks committed 2026-11-24 14:05:38 +01:00
1 parent 32b240469c
commit 36b2057991
12 files changed
+188 -21

No files matched your search

+9
View File
@@ -13,6 +13,12 @@ let
dhcpcdBase = builtins.head (builtins.match ".* --config ([^ ]+).*" config.systemd.services.dhcpcd.serviceConfig.ExecStart);
networkHelper = "${pkgs.python3}/bin/python3 ${./host-network.py}";
updateSocket = "/run/seiugw-update/request.sock";
updateAvailability = pkgs.writeShellScript "seiugw-update-availability" ''
export PATH=${lib.makeBinPath [ pkgs.coreutils pkgs.git ]}
export SEIUGW_UPDATE_REMOTE=${escapeShellArg cfg.updates.remote}
export SEIUGW_UPDATE_BRANCH=${escapeShellArg cfg.updates.branch}
${builtins.readFile ./system-update-availability.sh}
'';
updateWorker = pkgs.writeShellScript "seiugw-system-update" ''
export PATH=${lib.makeBinPath [ pkgs.coreutils pkgs.git pkgs.util-linux pkgs.systemd pkgs.curl pkgs.jq pkgs.sqlite pkgs.nix ]}:/run/current-system/sw/bin
export NIX_PATH=${escapeShellArg "nixos-config=/etc/nixos/configuration.nix:nixpkgs=${pkgs.path}"}
@@ -310,9 +316,12 @@ in
Gateway__Bacnet__DeviceInstance = toString cfg.bacnet.deviceInstance;
Gateway__Bacnet__IpPort = toString cfg.bacnet.ipPort;
Gateway__OpcUa__Port = toString cfg.opcUa.port;
Gateway__RunningCommit = cfg.package.sourceRevision or "";
} // lib.optionalAttrs cfg.updates.enable {
Gateway__UpdateSocketPath = updateSocket;
Gateway__UpdateStatusPath = "/var/lib/seiugw-updater/status.json";
Gateway__UpdateAvailabilityCommand = updateAvailability;
Gateway__UpdateBranch = cfg.updates.branch;
};
serviceConfig = {