summary refs log tree commit diff
path: root/nixos/modules/system
diff options
context:
space:
mode:
authorPhilip Taron <philip.taron@gmail.com>2023-10-17 09:43:37 -0700
committerPhilip Taron <philip.taron@gmail.com>2023-10-17 09:43:37 -0700
commit173a3a25f03045d97290e796d87dde5e2259903d (patch)
treea8b78a91cb9e41d0f6966a03051ea150c5b5e144 /nixos/modules/system
parent989cca26c4166d0e1793cb78cf8b9b25472c6f02 (diff)
downloadnixpkgs-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.nix21
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)
       ];