mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-02 18:23:44 +00:00
nixos/networkd: allow state ranges in RequiredForOnline
RequiredForOnline takes a boolean or a minimum operational state and an optional maximum operational state. In the latter case, range values are separated with colon.
This commit is contained in:
parent
8f21f3a0a3
commit
bc644aee70
@ -514,17 +514,24 @@ let
|
||||
(assertValueOneOf "Unmanaged" boolValues)
|
||||
(assertInt "Group")
|
||||
(assertRange "Group" 0 2147483647)
|
||||
(assertValueOneOf "RequiredForOnline" (boolValues ++ [
|
||||
"missing"
|
||||
"off"
|
||||
"no-carrier"
|
||||
"dormant"
|
||||
"degraded-carrier"
|
||||
"carrier"
|
||||
"degraded"
|
||||
"enslaved"
|
||||
"routable"
|
||||
]))
|
||||
(assertValueOneOf "RequiredForOnline" (boolValues ++ (
|
||||
let
|
||||
# https://freedesktop.org/software/systemd/man/networkctl.html#missing
|
||||
operationalStates = [
|
||||
"missing"
|
||||
"off"
|
||||
"no-carrier"
|
||||
"dormant"
|
||||
"degraded-carrier"
|
||||
"carrier"
|
||||
"degraded"
|
||||
"enslaved"
|
||||
"routable"
|
||||
];
|
||||
operationalStateRanges = concatLists (imap0 (i: min: map (max: "${min}:${max}") (drop i operationalStates)) operationalStates);
|
||||
in
|
||||
operationalStates ++ operationalStateRanges
|
||||
)))
|
||||
(assertValueOneOf "RequiredFamilyForOnline" [
|
||||
"ipv4"
|
||||
"ipv6"
|
||||
|
Loading…
Reference in New Issue
Block a user