From ad95bffd3d08d9d724f079aef8ecff462852eed0 Mon Sep 17 00:00:00 2001 From: Luke Granger-Brown Date: Sat, 8 Jan 2022 21:45:18 +0000 Subject: [PATCH] ops/nixos: tidy up networking.useDHCP --- ops/nixos/clouvider-fra01/default.nix | 2 -- ops/nixos/clouvider-lon01/default.nix | 1 - ops/nixos/etheroute-lon01/default.nix | 1 - ops/nixos/frantech-las01/default.nix | 1 - ops/nixos/frantech-lux01/default.nix | 1 - ops/nixos/frantech-nyc01/default.nix | 1 - ops/nixos/howl/default.nix | 5 ----- ops/nixos/lib/blade.nix | 1 - ops/nixos/lib/bvm.nix | 1 - ops/nixos/lib/common.nix | 1 + ops/nixos/porcorosso/default.nix | 18 +++++++----------- ops/nixos/swann/default.nix | 1 - ops/nixos/totoro/default.nix | 2 -- 13 files changed, 8 insertions(+), 28 deletions(-) diff --git a/ops/nixos/clouvider-fra01/default.nix b/ops/nixos/clouvider-fra01/default.nix index b3693d4953..ff75b6384b 100644 --- a/ops/nixos/clouvider-fra01/default.nix +++ b/ops/nixos/clouvider-fra01/default.nix @@ -102,7 +102,6 @@ in { "8.8.8.8" "8.8.4.4" ]; - useDHCP = false; defaultGateway = { address = "193.228.196.56"; interface = "enp1s0"; @@ -112,7 +111,6 @@ in { interface = "enp1s0"; }; interfaces.enp1s0 = { - useDHCP = false; ipv4.addresses = [{ address = "193.228.196.57"; prefixLength = 31; }]; ipv6.addresses = [{ address = "2a0f:93c0:0:22::2"; prefixLength = 126; }]; }; diff --git a/ops/nixos/clouvider-lon01/default.nix b/ops/nixos/clouvider-lon01/default.nix index 7aa6777c30..95dece0b0c 100644 --- a/ops/nixos/clouvider-lon01/default.nix +++ b/ops/nixos/clouvider-lon01/default.nix @@ -96,7 +96,6 @@ in { "8.8.8.8" "8.8.4.4" ]; - useDHCP = false; defaultGateway = { address = "185.198.188.28"; interface = "br-ext"; diff --git a/ops/nixos/etheroute-lon01/default.nix b/ops/nixos/etheroute-lon01/default.nix index 81dd419645..a45c09c504 100644 --- a/ops/nixos/etheroute-lon01/default.nix +++ b/ops/nixos/etheroute-lon01/default.nix @@ -123,7 +123,6 @@ in { "8.8.8.8" "8.8.4.4" ]; - useDHCP = false; defaultGateway = { address = "83.97.19.65"; interface = "eno1"; diff --git a/ops/nixos/frantech-las01/default.nix b/ops/nixos/frantech-las01/default.nix index 6ff7387845..e9b879a875 100644 --- a/ops/nixos/frantech-las01/default.nix +++ b/ops/nixos/frantech-las01/default.nix @@ -50,7 +50,6 @@ in { "8.8.8.8" "8.8.4.4" ]; - useDHCP = false; defaultGateway = { address = "205.185.116.1"; interface = "ens3"; diff --git a/ops/nixos/frantech-lux01/default.nix b/ops/nixos/frantech-lux01/default.nix index c825010bf7..eb3235db49 100644 --- a/ops/nixos/frantech-lux01/default.nix +++ b/ops/nixos/frantech-lux01/default.nix @@ -50,7 +50,6 @@ in { "8.8.8.8" "8.8.4.4" ]; - useDHCP = false; defaultGateway = { address = "107.189.4.1"; interface = "ens3"; diff --git a/ops/nixos/frantech-nyc01/default.nix b/ops/nixos/frantech-nyc01/default.nix index 2e838ebf9d..57a82a1ddc 100644 --- a/ops/nixos/frantech-nyc01/default.nix +++ b/ops/nixos/frantech-nyc01/default.nix @@ -53,7 +53,6 @@ in { "8.8.8.8" "8.8.4.4" ]; - useDHCP = false; defaultGateway = { address = "199.195.254.1"; interface = "ens3"; diff --git a/ops/nixos/howl/default.nix b/ops/nixos/howl/default.nix index f7c22e86cf..29823ed147 100644 --- a/ops/nixos/howl/default.nix +++ b/ops/nixos/howl/default.nix @@ -77,11 +77,6 @@ in { systemd.services.systemd-udev-settle.enable = false; systemd.services.NetworkManager-wait-online.enable = false; - # 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. - # Use NetworkManager instead. - networking.useDHCP = false; networking.dhcpcd.enable = false; networking.networkmanager.enable = true; diff --git a/ops/nixos/lib/blade.nix b/ops/nixos/lib/blade.nix index 9f6525de97..d31dc93703 100644 --- a/ops/nixos/lib/blade.nix +++ b/ops/nixos/lib/blade.nix @@ -90,7 +90,6 @@ in { "blade.as205479.net" "storage.blade.as205479.net" ]; - useDHCP = false; bridges = let br = interfaces: { interfaces = lib.mkDefault interfaces; rstp = false; }; in { diff --git a/ops/nixos/lib/bvm.nix b/ops/nixos/lib/bvm.nix index 5ec3320598..ab14c16f6d 100644 --- a/ops/nixos/lib/bvm.nix +++ b/ops/nixos/lib/bvm.nix @@ -55,7 +55,6 @@ "blade.as205479.net" ]; - useDHCP = false; defaultGateway = lib.mkDefault { address = "10.100.0.1"; interface = "enp1s0"; diff --git a/ops/nixos/lib/common.nix b/ops/nixos/lib/common.nix index 53b3f0cf54..6418855063 100644 --- a/ops/nixos/lib/common.nix +++ b/ops/nixos/lib/common.nix @@ -125,6 +125,7 @@ in switch-prebuilt ]; + networking.useDHCP = false; networking.firewall = { allowPing = true; logRefusedConnections = false; diff --git a/ops/nixos/porcorosso/default.nix b/ops/nixos/porcorosso/default.nix index 0f94eabcda..6019efda5d 100644 --- a/ops/nixos/porcorosso/default.nix +++ b/ops/nixos/porcorosso/default.nix @@ -110,12 +110,6 @@ in { systemd.services.systemd-udev-settle.enable = false; systemd.services.NetworkManager-wait-online.enable = false; - # 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. - # Use NetworkManager instead. - networking.useDHCP = false; - networking.interfaces.eno1.useDHCP = false; networking.networkmanager.enable = true; my.ip.tailscale = "100.125.26.108"; @@ -151,11 +145,13 @@ in { services.printing.drivers = with depot.pkgs; [ intermec-cups-driver ]; # Enable the X11 windowing system. - services.xserver.enable = true; - services.xserver.layout = "us"; - services.xserver.libinput.enable = true; - services.xserver.windowManager.i3.enable = true; - services.xserver.videoDrivers = [ "nvidia" ]; + services.xserver = { + enable = true; + layout = "us"; + libinput.enable = true; + windowManager.i3.enable = true; + videoDrivers = [ "nvidia" ]; + }; specialisation.intelGraphics.configuration = { my.specialisationName = "intelGraphics"; services.xserver.videoDrivers = lib.mkForce [ "intel" ]; diff --git a/ops/nixos/swann/default.nix b/ops/nixos/swann/default.nix index 9a4300869b..0d4f113667 100644 --- a/ops/nixos/swann/default.nix +++ b/ops/nixos/swann/default.nix @@ -47,7 +47,6 @@ in { hostName = "swann"; # Define your hostname. domain = "int.as205479.net"; nameservers = ["8.8.8.8" "8.8.4.4"]; - useDHCP = false; interfaces = { lo = { ipv4.addresses = [ diff --git a/ops/nixos/totoro/default.nix b/ops/nixos/totoro/default.nix index 9cc1d3c0e9..bf0638df40 100644 --- a/ops/nixos/totoro/default.nix +++ b/ops/nixos/totoro/default.nix @@ -86,13 +86,11 @@ in { hostName = "totoro"; # Define your hostname. domain = "int.as205479.net"; hostId = "676c08c4"; - useDHCP = false; interfaces.br-ext.useDHCP = true; bridges.br-ext.interfaces = [ "enp0s31f6" ]; interfaces.br-int = { virtual = true; - useDHCP = false; ipv4.addresses = [{ address = "10.0.0.2"; prefixLength = 24; }]; }; bridges.br-int.interfaces = [];