summary refs log tree commit diff
path: root/pkgs/tools/filesystems
diff options
context:
space:
mode:
authorJohn Ericson <Ericson2314@Yahoo.com>2017-04-17 16:48:10 -0400
committerJohn Ericson <Ericson2314@Yahoo.com>2017-04-17 17:04:04 -0400
commit85aa5005af530fef199cc41148e374e54d70e01e (patch)
tree296a184cc5e710e197f45a91babb107bf8509eae /pkgs/tools/filesystems
parentf3055a3c508b6ff3e926ece201887467dc2b5d73 (diff)
downloadnixpkgs-85aa5005af530fef199cc41148e374e54d70e01e.tar
nixpkgs-85aa5005af530fef199cc41148e374e54d70e01e.tar.gz
nixpkgs-85aa5005af530fef199cc41148e374e54d70e01e.tar.bz2
nixpkgs-85aa5005af530fef199cc41148e374e54d70e01e.tar.lz
nixpkgs-85aa5005af530fef199cc41148e374e54d70e01e.tar.xz
nixpkgs-85aa5005af530fef199cc41148e374e54d70e01e.tar.zst
nixpkgs-85aa5005af530fef199cc41148e374e54d70e01e.zip
Introduce `mapNullable` into lib and use it in a few places
Also simply some configure flag logic my grep also alerted me too.
Diffstat (limited to 'pkgs/tools/filesystems')
-rw-r--r--pkgs/tools/filesystems/ceph/generic.nix9
1 files changed, 4 insertions, 5 deletions
diff --git a/pkgs/tools/filesystems/ceph/generic.nix b/pkgs/tools/filesystems/ceph/generic.nix
index d21d790dac8..e4c8b0f33bc 100644
--- a/pkgs/tools/filesystems/ceph/generic.nix
+++ b/pkgs/tools/filesystems/ceph/generic.nix
@@ -31,11 +31,10 @@ with stdenv;
 with stdenv.lib;
 let
   inherit (python2Packages) python;
-  mkFlag = trueStr: falseStr: cond: name: val:
-    if cond == null then null else
-      "--${if cond != false then trueStr else falseStr}${name}"
-      + "${if val != null && cond != false then "=${val}" else ""}";
-
+  mkFlag = trueStr: falseStr: cond: name: val: "--"
+    + (if cond then trueStr else falseStr)
+    + name
+    + optionalString (val != null && cond != false) "=${val}";
   mkEnable = mkFlag "enable-" "disable-";
   mkWith = mkFlag "with-" "without-";
   mkOther = mkFlag "" "" true;