configuration.nix/hosts/rico1/network/default.nix

67 lines
1.4 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 ];
2024-11-17 10:28:43 +05:30
2024-11-16 22:10:11 +05:30
systemd = {
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";
2024-12-08 16:05:22 +05:30
Domains = [ "~." ];
2024-11-16 22:10:11 +05:30
};
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
};
};
};
};
};
2024-12-08 16:05:22 +05:30
services.resolved.enable = true;
2024-11-16 22:10:11 +05:30
networking = {
useDHCP = lib.mkDefault false;
useNetworkd = true;
};
}