mirror of
https://github.com/SebastianWendel/nixpkgs.git
synced 2024-09-21 04:49:01 +02: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,7 +514,10 @@ let
|
||||||
(assertValueOneOf "Unmanaged" boolValues)
|
(assertValueOneOf "Unmanaged" boolValues)
|
||||||
(assertInt "Group")
|
(assertInt "Group")
|
||||||
(assertRange "Group" 0 2147483647)
|
(assertRange "Group" 0 2147483647)
|
||||||
(assertValueOneOf "RequiredForOnline" (boolValues ++ [
|
(assertValueOneOf "RequiredForOnline" (boolValues ++ (
|
||||||
|
let
|
||||||
|
# https://freedesktop.org/software/systemd/man/networkctl.html#missing
|
||||||
|
operationalStates = [
|
||||||
"missing"
|
"missing"
|
||||||
"off"
|
"off"
|
||||||
"no-carrier"
|
"no-carrier"
|
||||||
|
@ -524,7 +527,11 @@ let
|
||||||
"degraded"
|
"degraded"
|
||||||
"enslaved"
|
"enslaved"
|
||||||
"routable"
|
"routable"
|
||||||
]))
|
];
|
||||||
|
operationalStateRanges = concatLists (imap0 (i: min: map (max: "${min}:${max}") (drop i operationalStates)) operationalStates);
|
||||||
|
in
|
||||||
|
operationalStates ++ operationalStateRanges
|
||||||
|
)))
|
||||||
(assertValueOneOf "RequiredFamilyForOnline" [
|
(assertValueOneOf "RequiredFamilyForOnline" [
|
||||||
"ipv4"
|
"ipv4"
|
||||||
"ipv6"
|
"ipv6"
|
||||||
|
|
Loading…
Reference in a new issue