0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-13 13:40:28 +03:00

Introduce mapNullable into lib and use it in a few places

Also simply some configure flag logic my grep also alerted me too.
This commit is contained in:
John Ericson 2017-04-17 16:48:10 -04:00
parent f3055a3c50
commit 85aa5005af
7 changed files with 18 additions and 14 deletions

View file

@ -4,7 +4,7 @@ with lib;
let
cfg = config.services.graphite;
writeTextOrNull = f: t: if t == null then null else pkgs.writeTextDir f t;
writeTextOrNull = f: t: mapNullable (pkgs.writeTextDir f) t;
dataDir = cfg.dataDir;

View file

@ -134,7 +134,7 @@ let
};
});
default = null;
apply = x: if x == null then null else _filter x;
apply = x: mapNullable _filter x;
description = ''
Optional http login credentials for metrics scraping.
'';