lib: refactor nixpkgsVersion with fileContents

+4 -2
+4 -2
lib/trivial.nix
··· 62 62 isInt add sub lessThan 63 63 seq deepSeq genericClosure; 64 64 65 + inherit (import ./strings.nix) fileContents; 66 + 65 67 # Return the Nixpkgs version number. 66 68 nixpkgsVersion = 67 69 let suffixFile = ../.version-suffix; in 68 - readFile ../.version 69 - + (if pathExists suffixFile then readFile suffixFile else "pre-git"); 70 + fileContents ../.version 71 + + (if pathExists suffixFile then fileContents suffixFile else "pre-git"); 70 72 71 73 # Whether we're being called by nix-shell. 72 74 inNixShell = builtins.getEnv "IN_NIX_SHELL" == "1";