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 908919e
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion modules/services/nginx.nix
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,23 @@ in
type =
with lib.types;
let
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 =
(listOf (oneOf [
(optionalListOf (oneOf [
str
(attrsOf (oneOf [
str
Expand Down

0 comments on commit 908919e

Please sign in to comment.