From f8a83b426000494c9b2fee5532f6b98beeeb8743 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Na=C3=AFm=20Favier?= Date: Fri, 17 Jun 2022 19:16:39 +0200 Subject: [PATCH 1/3] nixos/networkd: make default networks `RequiredForOnline` when possible When `systemd.network.wait-online.anyInterface` is enabled, `RequiredForOnline` really means "sufficient for online", so enable it. --- nixos/modules/tasks/network-interfaces-systemd.nix | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/nixos/modules/tasks/network-interfaces-systemd.nix b/nixos/modules/tasks/network-interfaces-systemd.nix index 069116ff0a6..65cd52a35cd 100644 --- a/nixos/modules/tasks/network-interfaces-systemd.nix +++ b/nixos/modules/tasks/network-interfaces-systemd.nix @@ -88,20 +88,20 @@ in # more likely to result in interfaces being configured to # use DHCP when they shouldn't. - # We set RequiredForOnline to false, because it's fairly - # common for such devices to have multiple interfaces and - # only one of them to be connected (e.g. a laptop with - # ethernet and WiFi interfaces). Maybe one day networkd will - # support "any"-style RequiredForOnline... + # When wait-online.anyInterface is enabled, RequiredForOnline really + # means "sufficient for online", so we can enable it. + # Otherwise, don't block the network coming online because of default networks. matchConfig.Name = ["en*" "eth*"]; DHCP = "yes"; - linkConfig.RequiredForOnline = lib.mkDefault false; + linkConfig.RequiredForOnline = + lib.mkDefault config.systemd.network.wait-online.anyInterface; }; networks."99-wireless-client-dhcp" = lib.mkIf cfg.useDHCP { # Like above, but this is much more likely to be correct. matchConfig.WLANInterfaceType = "station"; DHCP = "yes"; - linkConfig.RequiredForOnline = lib.mkDefault false; + linkConfig.RequiredForOnline = + lib.mkDefault config.systemd.network.wait-online.anyInterface; # We also set the route metric to one more than the default # of 1024, so that Ethernet is preferred if both are # available. From e1c1fdd8c222f646ce50e8b04469a238b59f0590 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Na=C3=AFm=20Favier?= Date: Fri, 17 Jun 2022 19:38:59 +0200 Subject: [PATCH 2/3] nixos/networkd: add `IPv6PrivacyExtensions=kernel` for default networks Maybe this could go in `genericNetwork`, but I don't know if it makes sense for bridges, bonds etc. and I don't want to break anything. --- nixos/modules/tasks/network-interfaces-systemd.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nixos/modules/tasks/network-interfaces-systemd.nix b/nixos/modules/tasks/network-interfaces-systemd.nix index 65cd52a35cd..1657fabcd9b 100644 --- a/nixos/modules/tasks/network-interfaces-systemd.nix +++ b/nixos/modules/tasks/network-interfaces-systemd.nix @@ -95,6 +95,7 @@ in DHCP = "yes"; linkConfig.RequiredForOnline = lib.mkDefault config.systemd.network.wait-online.anyInterface; + networkConfig.IPv6PrivacyExtensions = "kernel"; }; networks."99-wireless-client-dhcp" = lib.mkIf cfg.useDHCP { # Like above, but this is much more likely to be correct. @@ -102,6 +103,7 @@ in DHCP = "yes"; linkConfig.RequiredForOnline = lib.mkDefault config.systemd.network.wait-online.anyInterface; + networkConfig.IPv6PrivacyExtensions = "kernel"; # We also set the route metric to one more than the default # of 1024, so that Ethernet is preferred if both are # available. From 1be40195913e568eb5d88d3a62dde65f06845418 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Na=C3=AFm=20Favier?= Date: Sat, 18 Jun 2022 15:50:06 +0200 Subject: [PATCH 3/3] maintainers: update ncfavier's keys --- maintainers/maintainer-list.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index bc4be66d903..01c48ac1056 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -8987,7 +8987,7 @@ githubId = 4323933; name = "Naïm Favier"; keys = [{ - fingerprint = "51A0 705E 7DD2 3CBC 5EAA B43E 49B0 7322 580B 7EE2"; + fingerprint = "F3EB 4BBB 4E71 99BC 299C D4E9 95AF CE82 1190 8325"; }]; }; nckx = {