test-push using nh

This commit is contained in:
John Lancaster
2026-04-05 11:22:47 -05:00
parent e59aa7a5f1
commit 5fcd6abdb2
+7 -7
View File
@@ -5,6 +5,7 @@ let
testHost = "soteria"; # which host to test build
testTarget = "fded:fb16:653e:25da:be24:11ff:fea0:753f"; # test-nix
resolvedTarget = "test-nix";
# testTarget = "fded:fb16:653e:25da:be24:11ff:fe89:1cc3"; # soteria
in
@@ -15,12 +16,12 @@ in
resticPasswordFile = "${config.xdg.configHome}/restic/password.txt";
testPushCmd = (pkgs.writeShellScriptBin "test-push" ''
${lib.getExe' pkgs.coreutils "echo"} "Pushing ${testHost} to ${testTarget}"
${lib.getExe' pkgs.coreutils "mkdir"} -p /var/tmp/nix-build
${lib.getExe' pkgs.coreutils "chmod"} 1777 /var/tmp/nix-build
${lib.getExe pkgs.nixos-rebuild} switch \
--flake ${flakeDir}#${testHost} \
--target-host root@${testTarget}
${lib.getExe' pkgs.coreutils "echo"} "Pushing ${testHost} to ${resolvedTarget}"
${lib.getExe pkgs.nh} os switch ${flakeDir}#${testHost} \
-e passwordless \
--target-host ${resolvedTarget} \
--diff always \
"$@"
'');
in
{
@@ -34,7 +35,6 @@ in
restic
docker
desktop
# neovim
];
# TODO: make this more restrictive, rather than allowing all unfree packages
nixpkgs.config.allowUnfree = true;