Actually apply systemd-networkd configuration

Also disable networking.* options
This commit is contained in:
JuliusFreudenberger 2025-08-11 23:34:35 +02:00
parent 8e15acd0c6
commit f7c3edf779

View file

@ -4,7 +4,6 @@
imports = imports =
[ [
../../modules/nix.nix ../../modules/nix.nix
../../modules/network-server.nix
../../modules/locale.nix ../../modules/locale.nix
../../modules/server-cli.nix ../../modules/server-cli.nix
../../modules/sshd.nix ../../modules/sshd.nix
@ -43,22 +42,45 @@
bridges = [ "vmbr0" ]; bridges = [ "vmbr0" ];
}; };
networking.useDHCP = false;
systemd.network = {
enable = true;
links."10-wan" = {
matchConfig.Path = "pci-0000:01:00.0";
linkConfig.Name = "wan";
};
networks."10-wan" = {
matchConfig.Name = "enp1s0";
networkConfig = {
# start a DHCP Client for IPv4 Addressing/Routing
DHCP = "ipv4";
# accept Router Advertisements for Stateless IPv6 Autoconfiguraton (SLAAC)
IPv6AcceptRA = true;
};
# make routing on this interface a dependency for network-online.target
linkConfig.RequiredForOnline = "routable";
};
# Actually set up the vmbr0 bridge # Actually set up the vmbr0 bridge
systemd.network.networks."10-lan" = { networks."10-lan" = {
matchConfig.Name = [ "ens18" ]; matchConfig.Name = [ "ens18" ];
networkConfig = { networkConfig = {
Bridge = "vmbr0"; Bridge = "vmbr0";
}; };
}; };
systemd.network.netdevs."vmbr0" = { netdevs."vmbr0" = {
netdevConfig = { netdevConfig = {
Name = "vmbr0"; Name = "vmbr0";
Kind = "bridge"; Kind = "bridge";
}; };
}; };
systemd.network.networks."10-lan-bridge" = { networks."10-lan-bridge" = {
matchConfig.Name = "vmbr0"; matchConfig.Name = "vmbr0";
networkConfig = { networkConfig = {
IPv6AcceptRA = true; IPv6AcceptRA = true;
@ -66,6 +88,7 @@
}; };
linkConfig.RequiredForOnline = "routable"; linkConfig.RequiredForOnline = "routable";
}; };
};
# This option defines the first version of NixOS you have installed on this particular machine, # This option defines the first version of NixOS you have installed on this particular machine,
# and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions. # and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions.