summary refs log tree commit diff
path: root/nixos/modules/system
diff options
context:
space:
mode:
authorWill Fancher <elvishjerricco@gmail.com>2023-10-22 13:46:38 -0400
committerGitHub <noreply@github.com>2023-10-22 13:46:38 -0400
commit13f325005cc9037f558a24772cb4b8e9572163d4 (patch)
tree67d475c9780faba96852d8c7877ea681721040c4 /nixos/modules/system
parent3720ec25904c60938ec37a5d7b405e10faaedc26 (diff)
parent1a6c2e483747809f0fdb647c50bdae700021ac89 (diff)
downloadnixpkgs-13f325005cc9037f558a24772cb4b8e9572163d4.tar
nixpkgs-13f325005cc9037f558a24772cb4b8e9572163d4.tar.gz
nixpkgs-13f325005cc9037f558a24772cb4b8e9572163d4.tar.bz2
nixpkgs-13f325005cc9037f558a24772cb4b8e9572163d4.tar.lz
nixpkgs-13f325005cc9037f558a24772cb4b8e9572163d4.tar.xz
nixpkgs-13f325005cc9037f558a24772cb4b8e9572163d4.tar.zst
nixpkgs-13f325005cc9037f558a24772cb4b8e9572163d4.zip
Merge pull request #262740 from ElvishJerricco/systemd-stage-1-improve-udhcpc-assertion
systemd-stage-1: Improve udhcpc assertion
Diffstat (limited to 'nixos/modules/system')
-rw-r--r--nixos/modules/system/boot/initrd-network.nix2
-rw-r--r--nixos/modules/system/boot/networkd.nix6
2 files changed, 4 insertions, 4 deletions
diff --git a/nixos/modules/system/boot/initrd-network.nix b/nixos/modules/system/boot/initrd-network.nix
index 1d95742face..5bf38b6fa20 100644
--- a/nixos/modules/system/boot/initrd-network.nix
+++ b/nixos/modules/system/boot/initrd-network.nix
@@ -80,7 +80,7 @@ in
     };
 
     boot.initrd.network.udhcpc.enable = mkOption {
-      default = config.networking.useDHCP;
+      default = config.networking.useDHCP && !config.boot.initrd.systemd.enable;
       defaultText = "networking.useDHCP";
       type = types.bool;
       description = lib.mdDoc ''
diff --git a/nixos/modules/system/boot/networkd.nix b/nixos/modules/system/boot/networkd.nix
index cbb521f0b03..4be04092754 100644
--- a/nixos/modules/system/boot/networkd.nix
+++ b/nixos/modules/system/boot/networkd.nix
@@ -2985,10 +2985,10 @@ in
     stage2Config
     (mkIf config.boot.initrd.systemd.enable {
       assertions = [{
-        assertion = config.boot.initrd.network.udhcpc.extraArgs == [];
+        assertion = !config.boot.initrd.network.udhcpc.enable && config.boot.initrd.network.udhcpc.extraArgs == [];
         message = ''
-          boot.initrd.network.udhcpc.extraArgs is not supported when
-          boot.initrd.systemd.enable is enabled
+          systemd stage 1 networking does not support 'boot.initrd.network.udhcpc'. Configure
+          DHCP with 'networking.*' options or with 'boot.initrd.systemd.network' options.
         '';
       }];