From e272071a5a7cf66fcd401e564c1f84b02392a34d Mon Sep 17 00:00:00 2001 From: "Casper V. Kristensen" Date: Fri, 11 Aug 2023 18:02:36 +0200 Subject: [PATCH] systemd-networkd https://github.com/NixOS/nixpkgs/pull/202488 --- hosts/omega/hardware.nix | 6 +----- hosts/tor/hardware.nix | 6 +----- hosts/zeta/hardware.nix | 6 +----- modules/base/network.nix | 8 ++++++++ 4 files changed, 11 insertions(+), 15 deletions(-) diff --git a/hosts/omega/hardware.nix b/hosts/omega/hardware.nix index e09ab4e..d6e5413 100644 --- a/hosts/omega/hardware.nix +++ b/hosts/omega/hardware.nix @@ -31,12 +31,8 @@ } ]; - # Enables DHCP on each ethernet and wireless interface. In case of scripted networking - # (the default) this is the recommended approach. When using systemd-networkd it's - # still possible to use this option, but it's recommended to use it in conjunction - # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + # Enables DHCP on all ethernet and wireless LAN interfaces. networking.useDHCP = lib.mkDefault true; - # networking.interfaces.enp1s0.useDHCP = lib.mkDefault true; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; } diff --git a/hosts/tor/hardware.nix b/hosts/tor/hardware.nix index 4e726e7..f4c7313 100644 --- a/hosts/tor/hardware.nix +++ b/hosts/tor/hardware.nix @@ -31,12 +31,8 @@ } ]; - # Enables DHCP on each ethernet and wireless interface. In case of scripted networking - # (the default) this is the recommended approach. When using systemd-networkd it's - # still possible to use this option, but it's recommended to use it in conjunction - # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + # Enables DHCP on all ethernet and wireless LAN interfaces. networking.useDHCP = lib.mkDefault true; - # networking.interfaces.ens3.useDHCP = lib.mkDefault true; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; } diff --git a/hosts/zeta/hardware.nix b/hosts/zeta/hardware.nix index 85bb245..8f35523 100644 --- a/hosts/zeta/hardware.nix +++ b/hosts/zeta/hardware.nix @@ -31,12 +31,8 @@ } ]; - # Enables DHCP on each ethernet and wireless interface. In case of scripted networking - # (the default) this is the recommended approach. When using systemd-networkd it's - # still possible to use this option, but it's recommended to use it in conjunction - # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + # Enables DHCP on all ethernet and wireless LAN interfaces. networking.useDHCP = lib.mkDefault true; - # networking.interfaces.wlp2s0.useDHCP = lib.mkDefault true; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; powerManagement.cpuFreqGovernor = lib.mkDefault "performance"; diff --git a/modules/base/network.nix b/modules/base/network.nix index 5aa9e4e..1527f94 100644 --- a/modules/base/network.nix +++ b/modules/base/network.nix @@ -11,6 +11,14 @@ }; }; + # TODO: these systemd networkd settings will be the default once + # https://github.com/NixOS/nixpkgs/pull/202488 is merged. + networking.useNetworkd = true; + systemd.network = { + enable = true; + wait-online.anyInterface = true; + }; + services.resolved = { enable = true; dnssec = "true";