summaryrefslogtreecommitdiffstats
path: root/lib/trivial.nix
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2015-02-16 11:57:36 +0100
committerEelco Dolstra <eelco.dolstra@logicblox.com>2015-02-16 12:02:49 +0100
commit5d7000df689f2ee654cbb45ec440764c54074430 (patch)
treecbabdba21b1e835684524416232a61a132352d6f /lib/trivial.nix
parent5a0208d117b43fa2c67f1cd935c7123b45b92aff (diff)
Automatically set nix.nrBuildUsers to at least nix.maxJobs
Diffstat (limited to 'lib/trivial.nix')
-rw-r--r--lib/trivial.nix6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/trivial.nix b/lib/trivial.nix
index e073da4900cc..ed59eff48473 100644
--- a/lib/trivial.nix
+++ b/lib/trivial.nix
@@ -47,7 +47,11 @@ rec {
readFile ../.version
+ (if pathExists suffixFile then readFile suffixFile else "pre-git");
- # Whether we're being called by nix-shell. This is useful to
+ # Whether we're being called by nix-shell.
inNixShell = builtins.getEnv "IN_NIX_SHELL" == "1";
+ # Return minimum/maximum of two numbers.
+ min = x: y: if x < y then x else y;
+ max = x: y: if x > y then x else y;
+
}