diff options
author | Philip Taron <philip.taron@gmail.com> | 2023-10-17 09:43:37 -0700 |
---|---|---|
committer | Philip Taron <philip.taron@gmail.com> | 2023-10-17 09:43:37 -0700 |
commit | 173a3a25f03045d97290e796d87dde5e2259903d (patch) | |
tree | a8b78a91cb9e41d0f6966a03051ea150c5b5e144 /nixos/modules/system | |
parent | 989cca26c4166d0e1793cb78cf8b9b25472c6f02 (diff) | |
download | nixpkgs-173a3a25f03045d97290e796d87dde5e2259903d.tar nixpkgs-173a3a25f03045d97290e796d87dde5e2259903d.tar.gz nixpkgs-173a3a25f03045d97290e796d87dde5e2259903d.tar.bz2 nixpkgs-173a3a25f03045d97290e796d87dde5e2259903d.tar.lz nixpkgs-173a3a25f03045d97290e796d87dde5e2259903d.tar.xz nixpkgs-173a3a25f03045d97290e796d87dde5e2259903d.tar.zst nixpkgs-173a3a25f03045d97290e796d87dde5e2259903d.zip |
Remove restriction on PhysicalDevice being int; reformat and document the Type field
Diffstat (limited to 'nixos/modules/system')
-rw-r--r-- | nixos/modules/system/boot/networkd.nix | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/nixos/modules/system/boot/networkd.nix b/nixos/modules/system/boot/networkd.nix index 717f7ab2363..cbb521f0b03 100644 --- a/nixos/modules/system/boot/networkd.nix +++ b/nixos/modules/system/boot/networkd.nix @@ -471,14 +471,25 @@ let sectionWLAN = checkUnitConfig "WLAN" [ (assertOnlyFields [ - "PhysicalDevice" + "PhysicalDevice" # systemd supports both strings ("phy0") and indexes (0) here. "Type" "WDS" ]) - # systemd supports strings here too ("phy0") but index is good enough - (assertInt "PhysicalDevice") - (assertMinimum "PhysicalDevice" 0) - (assertValueOneOf "Type" ["ad-hoc" "station" "ap" "ap-vlan" "wds" "monitor" "mesh-point" "p2p-client" "p2p-go" "p2p-device" "ocb" "nan"]) + # See https://github.com/systemd/systemd/blob/main/src/basic/linux/nl80211.h#L3382 + (assertValueOneOf "Type" [ + "ad-hoc" + "station" + "ap" + "ap-vlan" + "wds" + "monitor" + "mesh-point" + "p2p-client" + "p2p-go" + "p2p-device" + "ocb" + "nan" + ]) (assertValueOneOf "WDS" boolValues) ]; |