diff --git a/README.md b/README.md index de48121..1ea447c 100644 --- a/README.md +++ b/README.md @@ -40,13 +40,12 @@ nix build '.#nixosConfigurations.test-vm.config.system.build.vm' ./result/bin/run-nixos-vm # In another terminal, get the ed25519 SSH hostkey, then stop the VM with CTRL-c -ssh-keyscan -p 2222 127.0.0.1 | grep ssh-ed25519 -... -[127.0.0.1]:2222 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMdCOs16W731ftPDqO+X6RZVSdwVVNw2Xfmcpk5pzbeO + +SSH_HOST_KEY=$(ssh-keyscan -p 2222 127.0.0.1 | grep '\[127.0.0.1\]:2222 ssh-ed25519' | awk '{print $2 " " $3}') # Edit secrets.nix and add the SSH hostkey to machine 'test-vm', starting with 'ssh-ed25519 ...' sed --in-place \ - 's|test-vm = .*|test-vm = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMdCOs16W731ftPDqO+X6RZVSdwVVNw2Xfmcpk5pzbeO host@test-vm";|' \ + "s|test-vm = .*|test-vm = \"$SSH_HOST_KEY host@test-vm\";|" \ secrets/secrets.nix # Rekey the secrets with agenix