nix-config/config/basic/net.nix

32 lines
775 B
Nix
Raw Normal View History

2024-07-26 22:12:48 +02:00
{ lib, config, ... }:
2023-11-28 00:40:46 +01:00
{
networking = {
useNetworkd = true;
dhcpcd.enable = false;
2023-12-17 16:34:05 +01:00
useDHCP = false;
2023-09-03 13:26:08 +02:00
# allow mdns port
2024-07-26 22:12:48 +02:00
firewall.allowedUDPPorts = [ 5353 ];
renameInterfacesByMac = lib.mkIf (!config.boot.isContainer) (
2024-07-26 22:12:48 +02:00
lib.mapAttrs (_: v: v.mac) (config.secrets.secrets.local.networking.interfaces or { })
);
};
systemd.network = {
enable = true;
wait-online.anyInterface = true;
};
system.nssDatabases.hosts = lib.mkMerge [
2024-07-26 22:12:48 +02:00
(lib.mkBefore [ "mdns_minimal [NOTFOUND=return]" ])
(lib.mkAfter [ "mdns" ])
];
services.resolved = {
enable = true;
2023-09-02 20:11:06 +02:00
# man I whish dnssec would be viable to use
2024-05-13 22:54:21 +02:00
dnssec = "false";
2023-09-02 20:11:06 +02:00
llmnr = "false";
extraConfig = ''
Domains=~.
MulticastDNS=true
'';
};
}