summary refs log tree commit diff
path: root/machines/fourmi
diff options
context:
space:
mode:
authorMel <mel@rnrd.eu>2026-04-24 23:35:19 +0200
committerMel <mel@rnrd.eu>2026-04-24 23:35:19 +0200
commit56c22cf8ae9de73bbc1c37ce0b1635ae7af9be64 (patch)
tree3ba1ca13dcf1ed9c0013f6bffddaee9392991b16 /machines/fourmi
parent127d8ff2c2e77a0cbfc7a2a3c962ef23b5ab7261 (diff)
downloadnetwork-56c22cf8ae9de73bbc1c37ce0b1635ae7af9be64.tar.zst
network-56c22cf8ae9de73bbc1c37ce0b1635ae7af9be64.zip
Migrate fully to systemd-networkd and nftables
Signed-off-by: Mel <mel@rnrd.eu>
Diffstat (limited to 'machines/fourmi')
-rw-r--r--machines/fourmi/devices.nix24
-rw-r--r--machines/fourmi/hardware.nix7
2 files changed, 17 insertions, 14 deletions
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.<interface>.useDHCP`.
-  networking.useDHCP = lib.mkDefault true;
-  # networking.interfaces.end0.useDHCP = lib.mkDefault true;
-  # networking.interfaces.wlan0.useDHCP = lib.mkDefault true;
 
 }