diff options
| author | Alejandro Soto <alejandro@34project.org> | 2024-06-23 20:38:42 -0600 |
|---|---|---|
| committer | Alejandro Soto <alejandro@34project.org> | 2024-06-23 20:40:11 -0600 |
| commit | f6668477e4342395e5329fff16077949bd03a4d9 (patch) | |
| tree | 2cf63d1add1241bf32eb142352369111d3813b38 | |
| parent | 85d997eb00a62c1954d5667348459e926ed58327 (diff) | |
sys/net: enable IPv6 RA on default interface
| -rw-r--r-- | sys/net.nix | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/sys/net.nix b/sys/net.nix index 4075a12..b441350 100644 --- a/sys/net.nix +++ b/sys/net.nix @@ -15,18 +15,28 @@ in }; config = { + environment.systemPackages = [ pkgs.dhcpcd ]; + networking = { hostName = cfg.hostname; + useDHCP = false; useNetworkd = true; - interfaces = mkIf (cfg.dhcpInterface != null) { - "${cfg.dhcpInterface}".useDHCP = true; - }; - wireguard.enable = true; }; - environment.systemPackages = [ pkgs.dhcpcd ]; + systemd.network.networks."40-${cfg.dhcpInterface}" = mkIf (cfg.dhcpInterface != null) { + matchConfig.Name = cfg.dhcpInterface; + + networkConfig = { + DHCP = "ipv4"; + IPv6AcceptRA = true; + IPv6PrivacyExtensions = "kernel"; + }; + + # make routing on this interface a dependency for network-online.target + linkConfig.RequiredForOnline = "routable"; + }; }; } |
