Merge pull request #262740 from ElvishJerricco/systemd-stage-1-improve-udhcpc-assertion

systemd-stage-1: Improve udhcpc assertion

authored by

Will Fancher and committed by
GitHub
13f32500 3720ec25

+4 -4
+1 -1
nixos/modules/system/boot/initrd-network.nix
··· 80 80 }; 81 81 82 82 boot.initrd.network.udhcpc.enable = mkOption { 83 - default = config.networking.useDHCP; 83 + default = config.networking.useDHCP && !config.boot.initrd.systemd.enable; 84 84 defaultText = "networking.useDHCP"; 85 85 type = types.bool; 86 86 description = lib.mdDoc ''
+3 -3
nixos/modules/system/boot/networkd.nix
··· 2985 2985 stage2Config 2986 2986 (mkIf config.boot.initrd.systemd.enable { 2987 2987 assertions = [{ 2988 - assertion = config.boot.initrd.network.udhcpc.extraArgs == []; 2988 + assertion = !config.boot.initrd.network.udhcpc.enable && config.boot.initrd.network.udhcpc.extraArgs == []; 2989 2989 message = '' 2990 - boot.initrd.network.udhcpc.extraArgs is not supported when 2991 - boot.initrd.systemd.enable is enabled 2990 + systemd stage 1 networking does not support 'boot.initrd.network.udhcpc'. Configure 2991 + DHCP with 'networking.*' options or with 'boot.initrd.systemd.network' options. 2992 2992 ''; 2993 2993 }]; 2994 2994