nixos/znc: Fix config generator for certain null values
The type of ZNC's config option specifies that a configuration like config.User.paul = null; should be valid, which is useful for clearing/disabling property sets like Users and Networks. However until now the config generator implementation didn't actually cover null values, meaning you'd get an error like error: value is null while a set was expected, at /foo.nix:29:10 This fixes the implementation to correcly allow clearing of property sets.
This commit is contained in:
parent
9db70b6a2a
commit
a27dc9d3ab
|
@ -47,11 +47,11 @@ let
|
|||
# Baz=baz
|
||||
# Qux=qux
|
||||
# </Foo>
|
||||
set = concatMap (subname: [
|
||||
set = concatMap (subname: optionals (value.${subname} != null) ([
|
||||
"<${name} ${subname}>"
|
||||
] ++ map (line: "\t${line}") (toLines value.${subname}) ++ [
|
||||
"</${name}>"
|
||||
]) (filter (v: v != null) (attrNames value));
|
||||
])) (filter (v: v != null) (attrNames value));
|
||||
|
||||
}.${builtins.typeOf value};
|
||||
|
||||
|
|
Loading…
Reference in New Issue