git.iko.soy/typeable/nixpkgs
on master help sign in
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.

commita27dc9d3ab31634d40905926203484e5d0f3336c authorSilvan Mosberger <infinisil@icloud.com> dateWed 1 May 2019, 00:06 (8 years ago) parent9db70b6
1 file changed+2−2
nixos/modules/services/networking/znc/default.nix+2−2
nixos/modules/services/networking/znc/default.nix+2−2
@@ -47,11 +47,11 @@ let
4747 # Baz=baz
4848 # Qux=qux
4949 # </Foo>
50− set = concatMap (subname: [
50+ set = concatMap (subname: optionals (value.${subname} != null) ([
5151 "<${name} ${subname}>"
5252 ] ++ map (line: "\t${line}") (toLines value.${subname}) ++ [
5353 "</${name}>"
54− ]) (filter (v: v != null) (attrNames value));
54+ ])) (filter (v: v != null) (attrNames value));
5555
5656 }.${builtins.typeOf value};
5757