1 import ../make-test-python.nix ({ lib, ... }:
4 name = "initrd-network-ssh";
5 meta = with lib.maintainers; {
6 maintainers = [ willibutz emily ];
14 "ip=${config.networking.primaryIPAddress}:::255.255.255.0::eth1:none"
16 boot.initrd.network = {
20 authorizedKeys = [ (readFile ./id_ed25519.pub) ];
22 hostKeys = [ ./ssh_host_ed25519_key ];
25 boot.initrd.extraUtilsCommands = ''
26 mkdir -p $out/secrets/etc/ssh
27 cat "${./ssh_host_ed25519_key}" > $out/secrets/etc/ssh/sh_host_ed25519_key
29 boot.initrd.preLVMCommands = ''
44 text = concatStrings [
46 "${toString (head (splitString " " (
47 toString (elemAt (splitString "\n" config.networking.extraHosts) 2)
49 "${readFile ./ssh_host_ed25519_key.pub}"
53 source = ./id_ed25519;
62 client.wait_for_unit("network.target")
65 def ssh_is_up(_) -> bool:
66 status, _ = client.execute("nc -z server 22")
70 with client.nested("waiting for SSH server to come up"):
75 "ssh -i /etc/sshKey -o UserKnownHostsFile=/etc/knownHosts server 'touch /fnord'"