configuration.nix/hosts/shared/networkd.nix

41 lines
928 B
Nix
Raw Normal View History

2024-11-09 20:27:33 +05:30
{ lib, config, ... }: {
networking = {
useNetworkd = true;
};
systemd = {
network = {
enable = true;
wait-online.enable = false;
networks = {
"41-ether" = {
enable = true;
matchConfig = {
Type = "ether";
2024-10-30 14:49:14 +05:30
Name = "e*";
};
networkConfig = {
DHCP = "yes";
2024-10-30 14:49:14 +05:30
IPv4Forwarding = "yes";
};
dhcpV4Config = {
UseDomains = true;
};
ipv6AcceptRAConfig = {
UseDomains = true;
};
linkConfig = {
RequiredForOnline = "yes";
};
2024-11-09 20:27:33 +05:30
routes = lib.mkIf ((lib.strings.toLower config.networking.hostName) != "bifrost") [
2024-10-27 12:54:10 +05:30
{
Destination = "165.232.180.97";
Gateway = "_dhcp4";
GatewayOnLink = "yes";
}
];
};
};
};
};
}