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