This commit is contained in:
Lucy 2025-09-16 12:26:17 +02:00
parent dee4fdfc60
commit a1da207bc2
2 changed files with 44 additions and 15 deletions

23
flake.lock generated
View file

@ -287,7 +287,8 @@
"flux": "flux", "flux": "flux",
"nix-minecraft": "nix-minecraft", "nix-minecraft": "nix-minecraft",
"nix-topology": "nix-topology", "nix-topology": "nix-topology",
"nixpkgs": "nixpkgs_4" "nixpkgs": "nixpkgs_4",
"treefmt-nix": "treefmt-nix"
} }
}, },
"systems": { "systems": {
@ -319,6 +320,26 @@
"repo": "default", "repo": "default",
"type": "github" "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", "root": "root",

View file

@ -8,7 +8,10 @@
pkgs, pkgs,
... ...
}: }:
let
crew_interface = "eno1np0";
alien_interface = "eno2np1";
in
{ {
imports = [ imports = [
# Include the results of the hardware scan. # Include the results of the hardware scan.
@ -28,21 +31,26 @@
# 192.168.42.5/24 # 192.168.42.5/24
# gw 192.168.42.1 # gw 192.168.42.1
# Static IP for eno2np1 networking.interfaces.${alien_interface} = {
systemd.network.networks."eno2np1" = { ipv4.addresses = [
matchConfig.Name = "eno2np1"; {
networkConfig = { address = "192.168.42.5";
Address = "192.168.42.144/24"; prefixLength = 24;
Gateway = "192.168.42.1"; }
}; ];
useDHCP = false; # static IP
}; };
# Let eno1np0 use DHCP networking.interfaces.${crew_interface} = {
systemd.network.networks."eno1np0" = { useDHCP = false; # bridge slave should not request DHCP
matchConfig.Name = "eno1np0";
networkConfig = {
DHCP = true;
}; };
networking.bridges.vmbr0 = {
interfaces = [ "${crew_interface}" ];
};
networking.interfaces.vmbr0 = {
useDHCP = true; # bridge gets IP via DHCP
}; };
# Set your time zone. # Set your time zone.