From 56c22cf8ae9de73bbc1c37ce0b1635ae7af9be64 Mon Sep 17 00:00:00 2001 From: Mel Date: Fri, 24 Apr 2026 23:35:19 +0200 Subject: Migrate fully to systemd-networkd and nftables Signed-off-by: Mel --- machines/fourmi/devices.nix | 24 +++++++++++++++++------- machines/fourmi/hardware.nix | 7 ------- 2 files changed, 17 insertions(+), 14 deletions(-) (limited to 'machines/fourmi') diff --git a/machines/fourmi/devices.nix b/machines/fourmi/devices.nix index c8d2e72..56d243f 100644 --- a/machines/fourmi/devices.nix +++ b/machines/fourmi/devices.nix @@ -51,18 +51,28 @@ }; networking = { - # todo: configure properly firewall.enable = lib.mkForce false; - - useDHCP = true; wireless = { enable = true; interfaces = [ "wlan0" ]; secretsFile = config.age.secrets.wireless-secrets.path; - networks = { - # yea this is my home network :3 - # (my boyfriends brother picked the name) - "Das asoziale Netzwerk".pskRaw = "ext:psk_home"; + networks."Das asoziale Netzwerk".pskRaw = "ext:psk_home"; + }; + }; + + systemd.network = { + networks = { + "10-wired" = { + name = "end0"; + DHCP = "yes"; + dhcpV4Config.RouteMetric = 100; + networkConfig.RequiredForOnline = "no"; + }; + "20-wireless" = { + name = "wlan0"; + DHCP = "yes"; + dhcpV4Config.RouteMetric = 600; + networkConfig.RequiredForOnline = "no"; }; }; }; diff --git a/machines/fourmi/hardware.nix b/machines/fourmi/hardware.nix index 1738e23..3395bdf 100644 --- a/machines/fourmi/hardware.nix +++ b/machines/fourmi/hardware.nix @@ -20,12 +20,5 @@ swapDevices = [ ]; - # 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`. - networking.useDHCP = lib.mkDefault true; - # networking.interfaces.end0.useDHCP = lib.mkDefault true; - # networking.interfaces.wlan0.useDHCP = lib.mkDefault true; } -- cgit 1.4.1