1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-08 19:23:54 +02:00

Add date of last commit to SourceInfo

This is primarily useful for version string generation, where we need
a monotonically increasing number. The revcount is the preferred thing
to use, but isn't available for GitHub flakes (since it requires
fetching the entire history). The last commit timestamp OTOH can be
extracted from GitHub tarballs.
This commit is contained in:
Eelco Dolstra 2019-05-28 20:34:02 +02:00
parent 479757dc15
commit 0f840483c7
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE
7 changed files with 61 additions and 30 deletions

View file

@ -19,7 +19,8 @@ let
releaseTools.sourceTarball {
name = "nix-tarball";
version = builtins.readFile ./.version;
versionSuffix = if officialRelease then "" else "pre${toString nix.revCount or 0}_${nix.shortRev or "0000000"}";
versionSuffix = if officialRelease then "" else
"pre${if nix ? lastModified then builtins.substring 0 8 nix.lastModified else toString nix.revCount or 0}_${nix.shortRev or "0000000"}";
src = nix;
inherit officialRelease;