summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorJohn Ericson <Ericson2314@yahoo.com>2017-04-17 17:12:14 -0400
committerGitHub <noreply@github.com>2017-04-17 17:12:14 -0400
commit37e5e71fdf098a45471537e9961672592ef6f72a (patch)
tree43eb5da139409f5882c5b3194192a7088fba231f /nixos
parent383706f36db17307b7c2650ad35773f6c5b410d1 (diff)
parent85aa5005af530fef199cc41148e374e54d70e01e (diff)
downloadnixpkgs-37e5e71fdf098a45471537e9961672592ef6f72a.tar
nixpkgs-37e5e71fdf098a45471537e9961672592ef6f72a.tar.gz
nixpkgs-37e5e71fdf098a45471537e9961672592ef6f72a.tar.bz2
nixpkgs-37e5e71fdf098a45471537e9961672592ef6f72a.tar.lz
nixpkgs-37e5e71fdf098a45471537e9961672592ef6f72a.tar.xz
nixpkgs-37e5e71fdf098a45471537e9961672592ef6f72a.tar.zst
nixpkgs-37e5e71fdf098a45471537e9961672592ef6f72a.zip
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.nix2
-rw-r--r--nixos/modules/services/monitoring/prometheus/default.nix2
2 files changed, 2 insertions, 2 deletions
diff --git a/nixos/modules/services/monitoring/graphite.nix b/nixos/modules/services/monitoring/graphite.nix
index c5352e5887d..98931e65bb5 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 32af41cc62f..b9435c02b1d 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.
         '';