From 941dc4fc23064e7a617d156bfea7785d14b508b2 Mon Sep 17 00:00:00 2001 From: Julien Malka Date: Sun, 7 Apr 2024 11:52:35 +0200 Subject: [PATCH] add ssh stuff to persistent --- scripts/bootstrap-machine.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/bootstrap-machine.nix b/scripts/bootstrap-machine.nix index 064d2f0..97a3d72 100644 --- a/scripts/bootstrap-machine.nix +++ b/scripts/bootstrap-machine.nix @@ -24,6 +24,14 @@ pkgs.writeShellScriptBin "bootstrap-machine" '' # Set the correct permissions so sshd will accept the key chmod 600 "$temp/etc/ssh/ssh_host_ed25519_key" + ssh-keygen -f "$temp/etc/ssh/ssh_host_ed25519_key" -y > "$temp/etc/ssh/ssh_host_ed25519_key.pub" + + chmod 644 "$temp/etc/ssh/ssh_host_ed25519_key.pub" + + mkdir -p "$temp/persistent" + + cp -r "$temp/ssh" "$temp/persistent/ssh" + nixos-anywhere --extra-files "$temp" --store-paths $(nix-build -A nixosConfigurations.\"$machine\".config.system.build.diskoScript) $(nix-build -A nixosConfigurations.\"$machine\".config.system.build.toplevel) "''${extra_args[@]}" root@"$ip" popd ''