nixos-servers/modules/networking/default.nix
2024-11-04 23:35:04 +01:00

40 lines
809 B
Nix

{
lib,
config,
...
}: {
config = {
networking = {
domain = "dmz";
nftables.enable = lib.mkDefault true;
useDHCP = false;
firewall.enable = lib.mkDefault true;
};
systemd.network = {
enable = true;
networks = lib.attrsets.mergeAttrsList [
(lib.optionalAttrs (! config.facter.lab.isRaspberryPi) {
"30-main-nic" = {
matchConfig.Name = "en*";
networkConfig = {
DHCP = "yes";
};
};
})
(lib.optionalAttrs config.facter.lab.isRaspberryPi {
"30-main-nic" = {
matchConfig.Name = "end*";
networkConfig = {
IPv6AcceptRA = true;
DHCP = "yes";
};
};
})
];
};
};
}