summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorGraham Christensen <graham@grahamc.com>2017-10-10 23:06:45 -0400
committerGraham Christensen <graham@grahamc.com>2017-10-11 06:51:36 -0400
commit5a43eec0704503f4b415814557ad22490a6165c1 (patch)
tree247ef6f8b0e8abd12c6809c798dd5cef1591a633 /pkgs
parent6b3b7085010a4d959b35204919a8d1228f26651f (diff)
downloadnixlib-5a43eec0704503f4b415814557ad22490a6165c1.tar
nixlib-5a43eec0704503f4b415814557ad22490a6165c1.tar.gz
nixlib-5a43eec0704503f4b415814557ad22490a6165c1.tar.bz2
nixlib-5a43eec0704503f4b415814557ad22490a6165c1.tar.lz
nixlib-5a43eec0704503f4b415814557ad22490a6165c1.tar.xz
nixlib-5a43eec0704503f4b415814557ad22490a6165c1.tar.zst
nixlib-5a43eec0704503f4b415814557ad22490a6165c1.zip
nixpkgs: expose .git-revision in the nixexprs like NixOS
nixos/lib/make-channel.nix:16:

    echo -n ${nixpkgs.rev or nixpkgs.shortRev} > .git-revision

This means the .git-revision exists in nixos channels, but not
Nixpkgs channels. Adding it to the nixpkgs channel makes it a
common API for any Nixpkgs use cases.
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/top-level/make-tarball.nix2
1 files changed, 2 insertions, 0 deletions
diff --git a/pkgs/top-level/make-tarball.nix b/pkgs/top-level/make-tarball.nix
index c7e5f21910bb..16940761e6dc 100644
--- a/pkgs/top-level/make-tarball.nix
+++ b/pkgs/top-level/make-tarball.nix
@@ -24,7 +24,9 @@ releaseTools.sourceTarball rec {
     eval "$preConfigure"
     releaseName=nixpkgs-$VERSION$VERSION_SUFFIX
     echo -n $VERSION_SUFFIX > .version-suffix
+    echo -n ${nixpkgs.rev or nixpkgs.shortRev} > .git-revision
     echo "release name is $releaseName"
+    echo "git-revision is $(cat .git-revision)"
   '';
 
   dontBuild = false;