diff options
author | Artturin <Artturin@artturin.com> | 2021-11-20 04:00:46 +0200 |
---|---|---|
committer | Artturin <Artturin@artturin.com> | 2022-02-09 19:35:19 +0200 |
commit | b4adac9ba985cd1741f48a3cec865f69a9442cda (patch) | |
tree | c0af145bf5263dfcbf1ed584b04e889f19127393 /nixos/modules/installer | |
parent | aaf13bb3bd00f506a52e2bebd1ddc8e27e66c62f (diff) | |
download | nixpkgs-b4adac9ba985cd1741f48a3cec865f69a9442cda.tar nixpkgs-b4adac9ba985cd1741f48a3cec865f69a9442cda.tar.gz nixpkgs-b4adac9ba985cd1741f48a3cec865f69a9442cda.tar.bz2 nixpkgs-b4adac9ba985cd1741f48a3cec865f69a9442cda.tar.lz nixpkgs-b4adac9ba985cd1741f48a3cec865f69a9442cda.tar.xz nixpkgs-b4adac9ba985cd1741f48a3cec865f69a9442cda.tar.zst nixpkgs-b4adac9ba985cd1741f48a3cec865f69a9442cda.zip |
nixos/nixos-generate-config: move dhcpConfig from configuration.nix to hardware-configuration.nix
Diffstat (limited to 'nixos/modules/installer')
-rw-r--r-- | nixos/modules/installer/tools/nixos-generate-config.pl | 7 | ||||
-rw-r--r-- | nixos/modules/installer/tools/tools.nix | 1 |
2 files changed, 5 insertions, 3 deletions
diff --git a/nixos/modules/installer/tools/nixos-generate-config.pl b/nixos/modules/installer/tools/nixos-generate-config.pl index 1220c1849d6..57aef50a0f6 100644 --- a/nixos/modules/installer/tools/nixos-generate-config.pl +++ b/nixos/modules/installer/tools/nixos-generate-config.pl @@ -558,6 +558,8 @@ if (!$noFilesystems) { $fsAndSwap .= "swapDevices =" . multiLineList(" ", @swapDevices) . ";\n"; } +my $networkingDhcpConfig = generateNetworkingDhcpConfig(); + my $hwConfig = <<EOF; # Do not modify this file! It was generated by ‘nixos-generate-config’ # and may be overwritten by future invocations. Please make changes @@ -572,6 +574,7 @@ my $hwConfig = <<EOF; boot.kernelModules = [$kernelModules ]; boot.extraModulePackages = [$modulePackages ]; $fsAndSwap +$networkingDhcpConfig ${\join "", (map { " $_\n" } (uniq @attrs))}} EOF @@ -580,13 +583,13 @@ sub generateNetworkingDhcpConfig { # The global useDHCP flag is deprecated, therefore explicitly set to false here. # Per-interface useDHCP will be mandatory in the future, so this generated config # replicates the default behaviour. - networking.useDHCP = false; + networking.useDHCP = lib.mkDefault false; EOF foreach my $path (glob "/sys/class/net/*") { my $dev = basename($path); if ($dev ne "lo") { - $config .= " networking.interfaces.$dev.useDHCP = true;\n"; + $config .= " networking.interfaces.$dev.useDHCP = lib.mkDefault true;\n"; } } diff --git a/nixos/modules/installer/tools/tools.nix b/nixos/modules/installer/tools/tools.nix index b7f508eeb3a..71aaf7f253d 100644 --- a/nixos/modules/installer/tools/tools.nix +++ b/nixos/modules/installer/tools/tools.nix @@ -141,7 +141,6 @@ in # Set your time zone. # time.timeZone = "Europe/Amsterdam"; - $networkingDhcpConfig # Configure network proxy if necessary # networking.proxy.default = "http://user:password\@proxy:port/"; # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; |