From bb80ff5a7bd3e118c6bd182f17768aa6bfc3bc76 Mon Sep 17 00:00:00 2001 From: Andreas Zweili Date: Mon, 4 Dec 2023 09:03:51 +0100 Subject: [PATCH] Make the management scripts easier to use --- .envrc | 2 ++ scripts/{test_build.sh => test-build} | 2 ++ scripts/{remote_switch.sh => update-all-machines} | 0 scripts/{update_single_machine.sh => update-single-machine} | 2 ++ 4 files changed, 6 insertions(+) rename scripts/{test_build.sh => test-build} (94%) rename scripts/{remote_switch.sh => update-all-machines} (100%) rename scripts/{update_single_machine.sh => update-single-machine} (90%) diff --git a/.envrc b/.envrc index 93fe653..e96093e 100644 --- a/.envrc +++ b/.envrc @@ -1,2 +1,4 @@ use nix eval "$shellHook" + +PATH_add ./scripts/ diff --git a/scripts/test_build.sh b/scripts/test-build similarity index 94% rename from scripts/test_build.sh rename to scripts/test-build index 0a89075..af68c13 100755 --- a/scripts/test_build.sh +++ b/scripts/test-build @@ -1,6 +1,8 @@ #!/usr/bin/env bash set -e +cd /home/andreas/.nixos + hosts=($(echo $(nix eval .#nixosConfigurations --apply 'pkgs: builtins.concatStringsSep " " (builtins.attrNames pkgs)') | xargs)) skip=( "desktop-vm" diff --git a/scripts/remote_switch.sh b/scripts/update-all-machines similarity index 100% rename from scripts/remote_switch.sh rename to scripts/update-all-machines diff --git a/scripts/update_single_machine.sh b/scripts/update-single-machine similarity index 90% rename from scripts/update_single_machine.sh rename to scripts/update-single-machine index 96153c2..ca2b48e 100755 --- a/scripts/update_single_machine.sh +++ b/scripts/update-single-machine @@ -1,5 +1,7 @@ #!/usr/bin/env bash +cd /home/andreas/.nixos + rsa_key="~/.nixos/secrets/ssh_keys/ansible/ansible.key" export NIX_SSHOPTS="-t -i $rsa_key"