summary refs log tree commit diff
path: root/lib/trivial.nix
diff options
context:
space:
mode:
authorEric Sagnes <eric.sagnes@gmail.com>2016-07-31 21:59:30 +0900
committerEric Sagnes <eric.sagnes@gmail.com>2016-08-01 18:35:26 +0900
commite276842f6adef45554f05f2aee8c938c8c651ed1 (patch)
tree7a40d6e282539634830040229157377366df8b77 /lib/trivial.nix
parent85d8b016600925791cbf970f69873dfac1f781cb (diff)
downloadnixlib-e276842f6adef45554f05f2aee8c938c8c651ed1.tar
nixlib-e276842f6adef45554f05f2aee8c938c8c651ed1.tar.gz
nixlib-e276842f6adef45554f05f2aee8c938c8c651ed1.tar.bz2
nixlib-e276842f6adef45554f05f2aee8c938c8c651ed1.tar.lz
nixlib-e276842f6adef45554f05f2aee8c938c8c651ed1.tar.xz
nixlib-e276842f6adef45554f05f2aee8c938c8c651ed1.tar.zst
nixlib-e276842f6adef45554f05f2aee8c938c8c651ed1.zip
lib: refactor nixpkgsVersion with fileContents
Diffstat (limited to 'lib/trivial.nix')
-rw-r--r--lib/trivial.nix6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/trivial.nix b/lib/trivial.nix
index 9821e3c138dd..f85c74ab88e3 100644
--- a/lib/trivial.nix
+++ b/lib/trivial.nix
@@ -62,11 +62,13 @@ rec {
     isInt add sub lessThan
     seq deepSeq genericClosure;
 
+  inherit (import ./strings.nix) fileContents;
+
   # Return the Nixpkgs version number.
   nixpkgsVersion =
     let suffixFile = ../.version-suffix; in
-    readFile ../.version
-    + (if pathExists suffixFile then readFile suffixFile else "pre-git");
+    fileContents ../.version
+    + (if pathExists suffixFile then fileContents suffixFile else "pre-git");
 
   # Whether we're being called by nix-shell.
   inNixShell = builtins.getEnv "IN_NIX_SHELL" == "1";