configuration.nix/hosts/rico0/network/default.nix

74 lines
1.5 KiB
Nix
Raw Normal View History

2024-11-17 10:28:43 +05:30
{ lib, ... }: {
2024-11-16 22:10:11 +05:30
imports = [ ./wireguard.nix ];
systemd = {
2024-11-17 10:28:43 +05:30
2024-11-16 22:10:11 +05:30
network = {
enable = true;
wait-online.enable = false;
networks = {
2024-12-07 19:18:06 +05:30
"20-virbr" = {
matchConfig = {
Name = "virbr*";
Type = "bridge";
};
linkConfig = {
Unmanaged = true;
};
};
"21-docker" = {
matchConfig = {
Name = "docker*";
Type = "bridge";
};
linkConfig = {
Unmanaged = true;
};
};
"22-veth" = {
matchConfig = {
Name = "veth*";
Type = "ether";
};
linkConfig = {
Unmanaged = true;
};
};
"40-ether" = {
2024-11-16 22:10:11 +05:30
enable = true;
matchConfig = {
Type = "ether";
};
networkConfig = {
DHCP = "yes";
IPv4Forwarding = "yes";
};
dhcpV4Config = {
UseDomains = true;
2024-12-07 19:18:06 +05:30
RouteMetric = 100;
};
ipv6AcceptRAConfig = {
RouteMetric = 100;
2024-11-16 22:10:11 +05:30
};
linkConfig = {
2024-12-07 19:18:06 +05:30
RequiredForOnline = "routable";
2024-11-16 22:10:11 +05:30
};
};
};
};
};
services.resolved = {
enable = true;
domains = [ "~." ];
fallbackDns = [ ];
};
networking = {
useDHCP = lib.mkDefault false;
nameservers = [
2024-11-17 17:22:10 +05:30
"10.10.10.1"
2024-11-16 22:10:11 +05:30
];
useNetworkd = true;
};
}