From ae6f3fa7d7c5aa0f35a7840f6ad142e16355c96c Mon Sep 17 00:00:00 2001 From: lassulus Date: Sat, 16 Dec 2023 22:52:01 +0100 Subject: [PATCH] checks: move ssh_keys to lib/ssh --- checks/backups/flake-module.nix | 6 +++--- checks/borgbackup/default.nix | 4 ++-- checks/{borgbackup/borg_test => lib/ssh/privkey} | 0 checks/{borgbackup/borg_test.pub => lib/ssh/pubkey} | 0 4 files changed, 5 insertions(+), 5 deletions(-) rename checks/{borgbackup/borg_test => lib/ssh/privkey} (100%) rename checks/{borgbackup/borg_test.pub => lib/ssh/pubkey} (100%) diff --git a/checks/backups/flake-module.nix b/checks/backups/flake-module.nix index be4a57e1..82f45ace 100644 --- a/checks/backups/flake-module.nix +++ b/checks/backups/flake-module.nix @@ -23,7 +23,7 @@ in services.sshd.enable = true; services.borgbackup.repos.testrepo = { authorizedKeys = [ - (builtins.readFile ../borgbackup/borg_test.pub) + (builtins.readFile ../lib/ssh/pubkey) ]; }; }; @@ -42,7 +42,7 @@ in networking.hostName = "client"; services.sshd.enable = true; users.users.root.openssh.authorizedKeys.keyFiles = [ - ../borgbackup/borg_test.pub + ../lib/ssh/pubkey ]; environment.systemPackages = [ self.packages.${pkgs.system}.clan-cli ]; environment.etc."install-closure".source = "${closureInfo}/store-paths"; @@ -97,7 +97,7 @@ in # setup client.succeed("mkdir -m 700 /root/.ssh") client.succeed( - "cat ${../borgbackup/borg_test} > /root/.ssh/id_ed25519" + "cat ${../lib/ssh/privkey} > /root/.ssh/id_ed25519" ) client.succeed("chmod 600 /root/.ssh/id_ed25519") client.wait_for_unit("sshd", timeout=30) diff --git a/checks/borgbackup/default.nix b/checks/borgbackup/default.nix index c8cb0c07..9833111f 100644 --- a/checks/borgbackup/default.nix +++ b/checks/borgbackup/default.nix @@ -9,7 +9,7 @@ services.openssh.enable = true; services.borgbackup.repos.testrepo = { authorizedKeys = [ - (builtins.readFile ./borg_test.pub) + (builtins.readFile ../lib/ssh/pubkey) ]; }; } @@ -22,7 +22,7 @@ enable = true; destinations.test = { repo = "borg@localhost:."; - rsh = "ssh -i ${./borg_test} -o StrictHostKeyChecking=no"; + rsh = "ssh -i ${../lib/ssh/privkey} -o StrictHostKeyChecking=no"; }; }; } diff --git a/checks/borgbackup/borg_test b/checks/lib/ssh/privkey similarity index 100% rename from checks/borgbackup/borg_test rename to checks/lib/ssh/privkey diff --git a/checks/borgbackup/borg_test.pub b/checks/lib/ssh/pubkey similarity index 100% rename from checks/borgbackup/borg_test.pub rename to checks/lib/ssh/pubkey