From b8c31b4e4a3caa72ab619a041a8390bc7db8ddf9 Mon Sep 17 00:00:00 2001 From: Rouven Seifert Date: Mon, 29 Jan 2024 16:23:56 +0100 Subject: [PATCH] initrd: fix network --- hosts/quitte/network.nix | 2 +- modules/initrd-ssh.nix | 25 +++++++++++++++++-------- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/hosts/quitte/network.nix b/hosts/quitte/network.nix index a194b4e..0e093d8 100644 --- a/hosts/quitte/network.nix +++ b/hosts/quitte/network.nix @@ -43,7 +43,7 @@ in enable = true; # Interfaces on the machine - networks."10-ether-bond" = { + networks."10-wired-default" = { matchConfig.Name = "ens18"; address = [ "141.30.30.169/25" ]; diff --git a/modules/initrd-ssh.nix b/modules/initrd-ssh.nix index a67eda6..828a5cc 100644 --- a/modules/initrd-ssh.nix +++ b/modules/initrd-ssh.nix @@ -3,16 +3,25 @@ # Generate another SSH host key for the machine: # $ ssh-keygen -t ed25519 -N "" -f /etc/ssh/ssh_host_ed25519_key_initrd -C HOSTNAME-initrd # Add the public key to your known_hosts and create an ssh config entry. -{ ... }: +{ config, ... }: { - boot.initrd.network = { - enable = true; - ssh = { + boot.initrd = { + systemd = { enable = true; - port = 222; - shell = "/bin/cryptsetup-askpass"; - hostKeys = [ "/etc/ssh/ssh_host_ed25519_key_initrd" ]; - # authorizedKeys option inherits root's authorizedKeys.keys, but not keyFiles + network = { + enable = true; + networks."10-wired-default" = config.systemd.network.networks."10-wired-default"; + }; + users.root.shell = "/bin/cryptsetup-askpass"; + }; + network = { + enable = true; + ssh = { + enable = true; + port = 222; + hostKeys = [ "/etc/ssh/ssh_host_ed25519_key_initrd" ]; + # authorizedKeys option inherits root's authorizedKeys.keys, but not keyFiles + }; }; }; }