summary refs log tree commit diff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Peebles <copumpkin@users.noreply.github.com>2017-04-13 09:45:31 -0400
committerGitHub <noreply@github.com>2017-04-13 09:45:31 -0400
commit09a9a472ee783b40c2a3dd287bbe9d3c60f8fc58 (patch)
tree2832fb78a53694685603701f740bd9535be2d783 /lib
parentc9ba39116c6e85f06cfba9c435fc437591bbca1c (diff)
parent3ab45f4b369c9c741b55ddedeaac4c797dc61c04 (diff)
downloadnixpkgs-09a9a472ee783b40c2a3dd287bbe9d3c60f8fc58.tar
nixpkgs-09a9a472ee783b40c2a3dd287bbe9d3c60f8fc58.tar.gz
nixpkgs-09a9a472ee783b40c2a3dd287bbe9d3c60f8fc58.tar.bz2
nixpkgs-09a9a472ee783b40c2a3dd287bbe9d3c60f8fc58.tar.lz
nixpkgs-09a9a472ee783b40c2a3dd287bbe9d3c60f8fc58.tar.xz
nixpkgs-09a9a472ee783b40c2a3dd287bbe9d3c60f8fc58.tar.zst
nixpkgs-09a9a472ee783b40c2a3dd287bbe9d3c60f8fc58.zip
Merge pull request #24830 from mayflower/refactor/boolToString
treewide: use boolToString function
Diffstat (limited to 'lib')
-rw-r--r--lib/trivial.nix5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/trivial.nix b/lib/trivial.nix
index acbd687dd98..62906339e60 100644
--- a/lib/trivial.nix
+++ b/lib/trivial.nix
@@ -30,6 +30,11 @@ rec {
   /* boolean “and” */
   and = x: y: x && y;
 
+  /* Convert a boolean to a string.
+     Note that toString on a bool returns "1" and "".
+  */
+  boolToString = b: if b then "true" else "false";
+
   /* Merge two attribute sets shallowly, right side trumps left
 
      Example: