From a89fe55896ce50aa71f607a7966d13d852512822 Mon Sep 17 00:00:00 2001 From: chn Date: Wed, 3 Jul 2024 10:42:15 +0800 Subject: [PATCH] system.initrd: fix network --- modules/system/initrd.nix | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/modules/system/initrd.nix b/modules/system/initrd.nix index 65b5f922..ec8030d7 100644 --- a/modules/system/initrd.nix +++ b/modules/system/initrd.nix @@ -14,14 +14,20 @@ inputs: }; config = let inherit (inputs.config.nixos.system) initrd; in inputs.lib.mkMerge [ - { boot.initrd.systemd.enable = true; } + { + boot = + { + initrd.systemd.enable = true; + kernelParams = [ "boot.shell_on_fail" "systemd.setenv=SYSTEMD_SULOGIN_FORCE=1" ]; + }; + } ( inputs.lib.mkIf (initrd.sshd.enable) { boot = { initrd.network = { enable = true; ssh = { enable = true; hostKeys = initrd.sshd.hostKeys; }; }; - kernelParams = [ "ip=dhcp" "boot.shell_on_fail" "systemd.setenv=SYSTEMD_SULOGIN_FORCE=1" ]; + kernelParams = [ "ip=dhcp" ]; }; } )