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",
"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",

View file

@ -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.