diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2014-02-19 18:47:48 +0100 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2014-02-19 19:03:16 +0100 |
commit | 484403bf0e229f857cafb67ec2e516ed7dfdc2d2 (patch) | |
tree | 0a9d837b0812e45ae4f0427fd5a2234a1bb4c8e7 /lib | |
parent | ad0732313d1d512f0cc504e7a5b354236ced49f2 (diff) |
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"
Diffstat (limited to 'lib')
-rw-r--r-- | lib/trivial.nix | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/trivial.nix b/lib/trivial.nix index 760a74ce6664..190cda6abd67 100644 --- a/lib/trivial.nix +++ b/lib/trivial.nix @@ -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"); + } |