Add a constant ‘nixpkgsVersion’

This makes it a bit easier to find out the current Nixpkgs version,
e.g.

  $ nix-instantiate --eval '<nixpkgs>' -A lib.nixpkgsVersion
  "14.02.35657.66f51a9"
This commit is contained in:
Eelco Dolstra
2014-02-19 19:03:16 +01:00
parent ad0732313d
commit 484403bf0e
+6
View File
@@ -41,4 +41,10 @@ rec {
pathExists readFile isBool isFunction
isInt add sub lessThan;
# Return the Nixpkgs version number.
nixpkgsVersion =
let suffixFile = ../.version-suffix; in
readFile ../.version
+ (if pathExists suffixFile then readFile suffixFile else "pre-git");
}