summaryrefslogtreecommitdiffstats
path: root/lib/trivial.nix
diff options
context:
space:
mode:
Diffstat (limited to 'lib/trivial.nix')
-rw-r--r--lib/trivial.nix9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/trivial.nix b/lib/trivial.nix
index a928e1dbca98..a6a4abba1189 100644
--- a/lib/trivial.nix
+++ b/lib/trivial.nix
@@ -58,11 +58,12 @@ rec {
inherit (lib.strings) fileContents;
+ version = fileContents ../.version;
+ suffix = let suffixFile = ../.version-suffix; in
+ if pathExists suffixFile then fileContents suffixFile else "pre-git";
+
# Return the Nixpkgs version number.
- nixpkgsVersion =
- let suffixFile = ../.version-suffix; in
- fileContents ../.version
- + (if pathExists suffixFile then fileContents suffixFile else "pre-git");
+ nixpkgsVersion = version + suffix;
# Whether we're being called by nix-shell.
inNixShell = builtins.getEnv "IN_NIX_SHELL" != "";