From a1da207bc25d9a8ca04f0f9dc9ac2911b189afc1 Mon Sep 17 00:00:00 2001 From: Lucy Date: Tue, 16 Sep 2025 12:26:17 +0200 Subject: [PATCH] meow --- flake.lock | 23 +++++++++++++++++++++- hosts/server/configuration.nix | 36 +++++++++++++++++++++------------- 2 files changed, 44 insertions(+), 15 deletions(-) diff --git a/flake.lock b/flake.lock index b4b2c2a..9edb5c7 100644 --- a/flake.lock +++ b/flake.lock @@ -287,7 +287,8 @@ "flux": "flux", "nix-minecraft": "nix-minecraft", "nix-topology": "nix-topology", - "nixpkgs": "nixpkgs_4" + "nixpkgs": "nixpkgs_4", + "treefmt-nix": "treefmt-nix" } }, "systems": { @@ -319,6 +320,26 @@ "repo": "default", "type": "github" } + }, + "treefmt-nix": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1756662192, + "narHash": "sha256-F1oFfV51AE259I85av+MAia221XwMHCOtZCMcZLK2Jk=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "1aabc6c05ccbcbf4a635fb7a90400e44282f61c4", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } } }, "root": "root", diff --git a/hosts/server/configuration.nix b/hosts/server/configuration.nix index bfe6460..45797d6 100644 --- a/hosts/server/configuration.nix +++ b/hosts/server/configuration.nix @@ -8,7 +8,10 @@ pkgs, ... }: - +let + crew_interface = "eno1np0"; + alien_interface = "eno2np1"; +in { imports = [ # Include the results of the hardware scan. @@ -28,21 +31,26 @@ # 192.168.42.5/24 # gw 192.168.42.1 - # Static IP for eno2np1 - systemd.network.networks."eno2np1" = { - matchConfig.Name = "eno2np1"; - networkConfig = { - Address = "192.168.42.144/24"; - Gateway = "192.168.42.1"; - }; + networking.interfaces.${alien_interface} = { + ipv4.addresses = [ + { + address = "192.168.42.5"; + prefixLength = 24; + } + ]; + useDHCP = false; # static IP }; - # Let eno1np0 use DHCP - systemd.network.networks."eno1np0" = { - matchConfig.Name = "eno1np0"; - networkConfig = { - DHCP = true; - }; + networking.interfaces.${crew_interface} = { + useDHCP = false; # bridge slave should not request DHCP + }; + + networking.bridges.vmbr0 = { + interfaces = [ "${crew_interface}" ]; + }; + + networking.interfaces.vmbr0 = { + useDHCP = true; # bridge gets IP via DHCP }; # Set your time zone.