switch update-system to systemd service

This commit is contained in:
2025-12-11 12:11:23 -05:00
parent 7e94b029bb
commit 372c612f22
2 changed files with 72 additions and 13 deletions

View File

@@ -22,6 +22,7 @@ in
imports = [
./python.nix
./ghostty.nix
./shared-services.nix
];
options.modules.sw = {
@@ -76,19 +77,7 @@ in
inputs.agenix.packages.${stdenv.hostPlatform.system}.default
# Custom update script
(writeShellScriptBin "update-system" ''
HOSTNAME=$(hostname)
FLAKE_URI="github:UGA-Innovation-Factory/nixos-systems"
# Pass arguments like --impure to nixos-rebuild
EXTRA_ARGS="$@"
if [[ "$HOSTNAME" == nix-surface* ]]; then
echo "Detected Surface tablet. Using remote build host."
sudo nixos-rebuild switch --flake "$FLAKE_URI" --build-host engr-ugaif@192.168.11.133 --refresh $EXTRA_ARGS
else
echo "Updating local system..."
sudo nixos-rebuild switch --flake "$FLAKE_URI" --refresh $EXTRA_ARGS
fi
systemctl start update-system
'')
];
}