aboutsummaryrefslogtreecommitdiff
path: root/infra/libkookie/nixpkgs/nixos/modules/system/boot/initrd-ssh.nix
diff options
context:
space:
mode:
Diffstat (limited to 'infra/libkookie/nixpkgs/nixos/modules/system/boot/initrd-ssh.nix')
-rw-r--r--infra/libkookie/nixpkgs/nixos/modules/system/boot/initrd-ssh.nix7
1 files changed, 6 insertions, 1 deletions
diff --git a/infra/libkookie/nixpkgs/nixos/modules/system/boot/initrd-ssh.nix b/infra/libkookie/nixpkgs/nixos/modules/system/boot/initrd-ssh.nix
index f7ef26103709..00ac83a18972 100644
--- a/infra/libkookie/nixpkgs/nixos/modules/system/boot/initrd-ssh.nix
+++ b/infra/libkookie/nixpkgs/nixos/modules/system/boot/initrd-ssh.nix
@@ -159,9 +159,14 @@ in
boot.initrd.extraUtilsCommandsTest = ''
# sshd requires a host key to check config, so we pass in the test's
+ tmpkey="$(mktemp initrd-ssh-testkey.XXXXXXXXXX)"
+ cp "${../../../tests/initrd-network-ssh/ssh_host_ed25519_key}" "$tmpkey"
+ # keys from Nix store are world-readable, which sshd doesn't like
+ chmod 600 "$tmpkey"
echo -n ${escapeShellArg sshdConfig} |
$out/bin/sshd -t -f /dev/stdin \
- -h ${../../../tests/initrd-network-ssh/ssh_host_ed25519_key}
+ -h "$tmpkey"
+ rm "$tmpkey"
'';
boot.initrd.network.postCommands = ''