Skip to content

Commit

Permalink
services/apache: use a listOf which accepts non-list things
Browse files Browse the repository at this point in the history
Signed-off-by: magic_rb <[email protected]>
  • Loading branch information
MagicRB committed Dec 17, 2024
1 parent e825ea7 commit 8d952b2
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions modules/services/nginx.nix
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,22 @@ in
type =
with lib.types;
let
self =
(listOf (oneOf [
optionalListOf =
elemType:
let
list = (types.listOf elemType);
in
list
// {
merge =
loc: defs:
list.merge loc (
map (def: if lib.isList def.value then def else def // { value = lib.singleton def.value; }) defs
);
check = lib.const true;
};
self = (
optionalListOf (oneOf [
str
(attrsOf (oneOf [
str
Expand All @@ -60,7 +74,8 @@ in
]))
(attrsOf self)
]))
]));
])
);
in
self // { description = "loop breaker"; };
};
Expand Down

0 comments on commit 8d952b2

Please sign in to comment.