nixos-servers/modules/networking/default.nix

42 lines
820 B
Nix
Raw Normal View History

2024-10-28 13:12:06 +00:00
{
lib,
config,
2024-10-28 13:12:06 +00:00
machine,
...
}: {
2024-04-13 14:06:35 +00:00
config = {
networking = {
domain = "dmz";
nftables.enable = lib.mkDefault true;
2024-04-13 14:06:35 +00:00
useDHCP = false;
firewall.enable = lib.mkDefault true;
2024-04-13 14:06:35 +00:00
};
systemd.network = {
enable = true;
networks = lib.attrsets.mergeAttrsList [
(lib.optionalAttrs (! config.facter.lab.isRaspberryPi) {
2024-04-13 14:06:35 +00:00
"30-main-nic" = {
matchConfig.Name = "en*";
networkConfig = {
DHCP = "yes";
};
};
})
(lib.optionalAttrs config.facter.lab.isRaspberryPi {
2024-04-13 14:06:35 +00:00
"30-main-nic" = {
matchConfig.Name = "end*";
networkConfig = {
IPv6AcceptRA = true;
DHCP = "yes";
};
};
})
];
};
};
}