From f6668477e4342395e5329fff16077949bd03a4d9 Mon Sep 17 00:00:00 2001 From: Alejandro Soto Date: Sun, 23 Jun 2024 20:38:42 -0600 Subject: sys/net: enable IPv6 RA on default interface --- sys/net.nix | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'sys') 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"; + }; }; } -- cgit v1.2.3