diff options
author | github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> | 2023-10-04 12:01:34 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-04 12:01:34 +0000 |
commit | 2dc3af6ef92ac370919f3b2962c91f21b30c5d16 (patch) | |
tree | 573f216f893867a919d7beadfbeab085f7f0f808 /nixos/modules/tasks | |
parent | b7750daf119c1a9aab35f7d2a74992a8cb94fc5c (diff) | |
parent | c7a3c2d71b34df36c507d9ad52a14df54bba0474 (diff) | |
download | nixpkgs-2dc3af6ef92ac370919f3b2962c91f21b30c5d16.tar nixpkgs-2dc3af6ef92ac370919f3b2962c91f21b30c5d16.tar.gz nixpkgs-2dc3af6ef92ac370919f3b2962c91f21b30c5d16.tar.bz2 nixpkgs-2dc3af6ef92ac370919f3b2962c91f21b30c5d16.tar.lz nixpkgs-2dc3af6ef92ac370919f3b2962c91f21b30c5d16.tar.xz nixpkgs-2dc3af6ef92ac370919f3b2962c91f21b30c5d16.tar.zst nixpkgs-2dc3af6ef92ac370919f3b2962c91f21b30c5d16.zip |
Merge staging-next into staging
Diffstat (limited to 'nixos/modules/tasks')
-rw-r--r-- | nixos/modules/tasks/network-interfaces-scripted.nix | 2 | ||||
-rw-r--r-- | nixos/modules/tasks/network-interfaces-systemd.nix | 9 | ||||
-rw-r--r-- | nixos/modules/tasks/network-interfaces.nix | 18 |
3 files changed, 19 insertions, 10 deletions
diff --git a/nixos/modules/tasks/network-interfaces-scripted.nix b/nixos/modules/tasks/network-interfaces-scripted.nix index 24f0c37acf9..67ef152c4b6 100644 --- a/nixos/modules/tasks/network-interfaces-scripted.nix +++ b/nixos/modules/tasks/network-interfaces-scripted.nix @@ -62,7 +62,7 @@ let } // optionalAttrs (i.mtu != null) { MTUBytes = toString i.mtu; } // optionalAttrs (i.wakeOnLan.enable == true) { - WakeOnLan = "magic"; + WakeOnLan = concatStringsSep " " i.wakeOnLan.policy; }; }; in listToAttrs (map createNetworkLink interfaces); diff --git a/nixos/modules/tasks/network-interfaces-systemd.nix b/nixos/modules/tasks/network-interfaces-systemd.nix index 679567cbb73..86eed4214f8 100644 --- a/nixos/modules/tasks/network-interfaces-systemd.nix +++ b/nixos/modules/tasks/network-interfaces-systemd.nix @@ -59,23 +59,14 @@ let # more likely to result in interfaces being configured to # use DHCP when they shouldn't. - # 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 (if initrd - then config.boot.initrd.systemd.network.wait-online.anyInterface - else config.systemd.network.wait-online.anyInterface); networkConfig.IPv6PrivacyExtensions = "kernel"; }; networks."99-wireless-client-dhcp" = { # Like above, but this is much more likely to be correct. matchConfig.WLANInterfaceType = "station"; 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 diff --git a/nixos/modules/tasks/network-interfaces.nix b/nixos/modules/tasks/network-interfaces.nix index 0d4033ca943..fe77a444595 100644 --- a/nixos/modules/tasks/network-interfaces.nix +++ b/nixos/modules/tasks/network-interfaces.nix @@ -327,6 +327,24 @@ let default = false; description = lib.mdDoc "Whether to enable wol on this interface."; }; + policy = mkOption { + type = with types; listOf ( + enum ["phy" "unicast" "multicast" "broadcast" "arp" "magic" "secureon"] + ); + default = ["magic"]; + description = lib.mdDoc '' + The [Wake-on-LAN policy](https://www.freedesktop.org/software/systemd/man/systemd.link.html#WakeOnLan=) + to set for the device. + + The options are + - `phy`: Wake on PHY activity + - `unicast`: Wake on unicast messages + - `multicast`: Wake on multicast messages + - `broadcast`: Wake on broadcast messages + - `arp`: Wake on ARP + - `magic`: Wake on receipt of a magic packet + ''; + }; }; }; |