This repository has been archived on 2025-02-21. You can view files and clone it, but cannot push or open issues or pull requests.
nixos-servers/nixos-modules/networking/default.nix

39 lines
777 B
Nix
Raw Normal View History

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