diff options
author | Daniel Peebles <copumpkin@users.noreply.github.com> | 2017-04-13 09:45:31 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-13 09:45:31 -0400 |
commit | 09a9a472ee783b40c2a3dd287bbe9d3c60f8fc58 (patch) | |
tree | 2832fb78a53694685603701f740bd9535be2d783 /lib | |
parent | c9ba39116c6e85f06cfba9c435fc437591bbca1c (diff) | |
parent | 3ab45f4b369c9c741b55ddedeaac4c797dc61c04 (diff) |
Merge pull request #24830 from mayflower/refactor/boolToString
treewide: use boolToString function
Diffstat (limited to 'lib')
-rw-r--r-- | lib/trivial.nix | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/trivial.nix b/lib/trivial.nix index acbd687dd98f..62906339e605 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: |