diff options
author | John Ericson <Ericson2314@yahoo.com> | 2017-04-17 17:12:14 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-17 17:12:14 -0400 |
commit | 37e5e71fdf098a45471537e9961672592ef6f72a (patch) | |
tree | 43eb5da139409f5882c5b3194192a7088fba231f /nixos | |
parent | 383706f36db17307b7c2650ad35773f6c5b410d1 (diff) | |
parent | 85aa5005af530fef199cc41148e374e54d70e01e (diff) |
Merge pull request #24974 from Ericson2314/mapNullable
Introduce `mapNullable` into lib and use it in a few places
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/services/monitoring/graphite.nix | 2 | ||||
-rw-r--r-- | nixos/modules/services/monitoring/prometheus/default.nix | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/nixos/modules/services/monitoring/graphite.nix b/nixos/modules/services/monitoring/graphite.nix index c5352e5887da..98931e65bb56 100644 --- a/nixos/modules/services/monitoring/graphite.nix +++ b/nixos/modules/services/monitoring/graphite.nix @@ -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; diff --git a/nixos/modules/services/monitoring/prometheus/default.nix b/nixos/modules/services/monitoring/prometheus/default.nix index 32af41cc62fc..b9435c02b1de 100644 --- a/nixos/modules/services/monitoring/prometheus/default.nix +++ b/nixos/modules/services/monitoring/prometheus/default.nix @@ -141,7 +141,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. ''; |