initrd: fix network

This commit is contained in:
Rouven Seifert 2024-01-29 16:23:56 +01:00
parent ccd6290fb7
commit b8c31b4e4a
Signed by: rouven.seifert
GPG key ID: B95E8FE6B11C4D09
2 changed files with 18 additions and 9 deletions

View file

@ -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" ];

View file

@ -3,17 +3,26 @@
# 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 = {
boot.initrd = {
systemd = {
enable = true;
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;
shell = "/bin/cryptsetup-askpass";
hostKeys = [ "/etc/ssh/ssh_host_ed25519_key_initrd" ];
# authorizedKeys option inherits root's authorizedKeys.keys, but not keyFiles
};
};
};
}