From e29dd8a2283399b7e046937340509d5aec4b52ba Mon Sep 17 00:00:00 2001 From: Collin Williams <96917990+bluedragon1221@users.noreply.github.com> Date: Wed, 29 Jul 2026 06:54:49 -0500 Subject: changes --- modules/networking/nixos/networkd.nix | 44 +++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 modules/networking/nixos/networkd.nix (limited to 'modules/networking/nixos/networkd.nix') diff --git a/modules/networking/nixos/networkd.nix b/modules/networking/nixos/networkd.nix new file mode 100644 index 0000000..2c7f580 --- /dev/null +++ b/modules/networking/nixos/networkd.nix @@ -0,0 +1,44 @@ +{ + # lib, + config, + ... +}: let + cfg = config.collinux.system.network; + dhcp_enabled = cfg.static == null; + + device = + if (cfg.wireless == null) + then "eth0" + else "wl*"; +in { + networking.useNetworkd = true; + systemd.network = { + enable = true; + + wait-online = { + enable = true; + ignoredInterfaces = ["docker0"]; + anyInterface = true; + }; + + networks."11-default" = + if dhcp_enabled + then { + name = device; + networkConfig.DHCP = "yes"; + + # never accept dhcp dns + dhcpV4Config.UseDNS = "no"; + dhcpV6Config.UseDNS = "no"; + } + else { + name = device; + networkConfig = { + Address = cfg.static.ip; + Gateway = cfg.static.gateway; + DHCP = "no"; + # DNS is managed by systemd-resolved (not specified here) + }; + }; + }; +} -- cgit v1.3.1