From 8e42949a2421485c34fa56cff3e768af1c91459e Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Sat, 30 Apr 2022 00:26:46 +0200 Subject: nixos/nixos-generate-config: use networking.useDHCP by default Currently we're still using scripted networking by default. A problem with scripted networking is that having `useDHCP` on potentially non-existing interfaces (e.g. an ethernet interface for USB tethering) can cause the boot to hang. Closes #107908 --- nixos/modules/installer/tools/nixos-generate-config.pl | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'nixos/modules/installer') diff --git a/nixos/modules/installer/tools/nixos-generate-config.pl b/nixos/modules/installer/tools/nixos-generate-config.pl index fb5d3ba47325..6d32d727501e 100644 --- a/nixos/modules/installer/tools/nixos-generate-config.pl +++ b/nixos/modules/installer/tools/nixos-generate-config.pl @@ -581,17 +581,19 @@ ${\join "", (map { " $_\n" } (uniq @attrs))}} EOF sub generateNetworkingDhcpConfig { + # FIXME disable networking.useDHCP by default when switching to networkd. my $config = <.useDHCP`. + networking.useDHCP = lib.mkDefault true; EOF foreach my $path (glob "/sys/class/net/*") { my $dev = basename($path); if ($dev ne "lo") { - $config .= " networking.interfaces.$dev.useDHCP = lib.mkDefault true;\n"; + $config .= " # networking.interfaces.$dev.useDHCP = lib.mkDefault true;\n"; } } -- cgit 1.4.1