92 lines
2.3 KiB
Nix
92 lines
2.3 KiB
Nix
{ inputs, lib, pkgs, hostname, ... }:
|
|
|
|
let
|
|
hostname = "orion";
|
|
networks_dhcp_use_dns = "no";
|
|
networks_dhcp = "yes";
|
|
networks_multicast_dns = "yes";
|
|
networks_ipv6_privacy = "yes";
|
|
networks_ipv6_accept_ra = "yes";
|
|
networks_network_config = {
|
|
DHCP = networks_dhcp;
|
|
MulticastDNS = networks_multicast_dns;
|
|
IPv6PrivacyExtensions = networks_ipv6_privacy;
|
|
IPv6AcceptRA = networks_ipv6_accept_ra;
|
|
};
|
|
resolved_nameservers = [
|
|
"198.180.150.12#rgnet-iad.anycast.uncensoreddns.org"
|
|
"2001:418:8006::12:853#rgnet-iad.anycast.uncensoreddns.org"
|
|
"194.242.2.2#dns.mullvad.net"
|
|
"2a07:e340::2:853#dns.mullvad.net"
|
|
];
|
|
resolved_fallback_nameservers = [
|
|
"1.1.1.1#cloudflare-dns.com"
|
|
"1.0.0.1#cloudflare-dns.com"
|
|
"2606:4700:4700::1111#cloudflare-dns.com"
|
|
"2606:4700:4700::1001#cloudflare-dns.com"
|
|
];
|
|
in {
|
|
systemd.network = {
|
|
enable = true;
|
|
networks = {
|
|
"10-wlan" = {
|
|
matchConfig.Name = [ "wl*" ];
|
|
networkConfig = networks_network_config;
|
|
dhcpV4Config = {
|
|
RouteMetric = 600;
|
|
UseDNS = networks_dhcp_use_dns;
|
|
};
|
|
ipv6AcceptRAConfig = {
|
|
RouteMetric = 600;
|
|
UseDNS = networks_dhcp_use_dns;
|
|
};
|
|
};
|
|
"10-ethernet" = {
|
|
matchConfig.name = [ "en*" "eth*" ];
|
|
networkConfig = networks_network_config;
|
|
dhcpV4Config = {
|
|
RouteMetric = 100;
|
|
UseDNS = networks_dhcp_use_dns;
|
|
};
|
|
ipv6AcceptRAConfig = {
|
|
RouteMetric = 100;
|
|
UseDNS = networks_dhcp_use_dns;
|
|
};
|
|
};
|
|
"10-wwan" = {
|
|
matchConfig.name = [ "ww*" ];
|
|
networkConfig = networks_network_config;
|
|
dhcpV4Config = {
|
|
RouteMetric = 700;
|
|
UseDNS = networks_dhcp_use_dns;
|
|
};
|
|
ipv6AcceptRAConfig = {
|
|
RouteMetric = 700;
|
|
UseDNS = networks_dhcp_use_dns;
|
|
};
|
|
};
|
|
};
|
|
};
|
|
|
|
services.resolved = {
|
|
enable = true;
|
|
dnssec = "allow-downgrade";
|
|
domains = resolved_nameservers;
|
|
fallbackDns = resolved_fallback_nameservers;
|
|
llmnr = "resolve";
|
|
extraConfig = ''
|
|
MulticastDNS=yes
|
|
DNSOverTLS=yes
|
|
CacheFromLocalhost=no
|
|
Cache=yes
|
|
Domains=~.
|
|
'';
|
|
};
|
|
networking = {
|
|
hostName = "${hostname}";
|
|
wireless.iwd.enable = true;
|
|
useNetworkd = true;
|
|
};
|
|
|
|
}
|