Skip to content

Commit 85334b9

Browse files
committed
networking: Add default value for DHCP
Replicates the behavior of nixos-generate-config which is to configure `useDCHP` to default to true if there are more than 0 network interfaces. See https://github.com/NixOS/nixpkgs/blob/f59db697ef71a9cbebd11cc81d87d184866382ff/nixos/modules/installer/tools/nixos-generate-config.pl#L608
1 parent 15b6531 commit 85334b9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

modules/nixos/networking/default.nix

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1+
{ config, lib, ... }:
12
{
23
imports = [
34
./broadcom.nix
45
./intel.nix
56
];
7+
config.networking = lib.mkIf (builtins.length (config.facter.report.network_interface or [ ]) > 0) {
8+
useDHCP = lib.mkDefault true;
9+
};
610
}

0 commit comments

Comments
 (0)