configuration.nix/hosts/bifrost/network/default.nix

39 lines
768 B
Nix
Raw Normal View History

2024-11-16 22:10:11 +05:30
{ lib, ... }: {
imports = [ ./firewall.nix ./wireguard.nix ];
2024-11-17 10:28:43 +05:30
2024-11-16 22:10:11 +05:30
boot.kernel.sysctl."net.ipv4.ip_forward" = 1;
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 = {
"41-ether" = {
enable = true;
matchConfig = {
Type = "ether";
};
networkConfig = {
DHCP = "yes";
IPv4Forwarding = "yes";
2024-12-08 15:28:53 +05:30
Domains = [ "~." ];
2024-11-16 22:10:11 +05:30
};
dhcpV4Config = {
UseDomains = true;
};
linkConfig = {
RequiredForOnline = "yes";
};
};
};
};
};
2024-12-08 15:28:53 +05:30
services.resolved.enable = true;
2024-11-16 22:10:11 +05:30
networking = {
useDHCP = lib.mkDefault false;
useNetworkd = true;
};
}