lib: refactor nixpkgsVersion with fileContents
This commit is contained in:
parent
85d8b01660
commit
e276842f6a
@ -62,11 +62,13 @@ rec {
|
|||||||
isInt add sub lessThan
|
isInt add sub lessThan
|
||||||
seq deepSeq genericClosure;
|
seq deepSeq genericClosure;
|
||||||
|
|
||||||
|
inherit (import ./strings.nix) fileContents;
|
||||||
|
|
||||||
# Return the Nixpkgs version number.
|
# Return the Nixpkgs version number.
|
||||||
nixpkgsVersion =
|
nixpkgsVersion =
|
||||||
let suffixFile = ../.version-suffix; in
|
let suffixFile = ../.version-suffix; in
|
||||||
readFile ../.version
|
fileContents ../.version
|
||||||
+ (if pathExists suffixFile then readFile suffixFile else "pre-git");
|
+ (if pathExists suffixFile then fileContents suffixFile else "pre-git");
|
||||||
|
|
||||||
# Whether we're being called by nix-shell.
|
# Whether we're being called by nix-shell.
|
||||||
inNixShell = builtins.getEnv "IN_NIX_SHELL" == "1";
|
inNixShell = builtins.getEnv "IN_NIX_SHELL" == "1";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user