Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose lastModified attribute #2898

Merged
merged 2 commits into from May 29, 2019
Merged

Expose lastModified attribute #2898

merged 2 commits into from May 29, 2019

Conversation

edolstra
Copy link
Member

The lastModified attribute of a flake is the timestamp of the last commit. This is primarily useful for generating version strings, since unlike revCount, it's supported for both git and github flakes. For example:

name = "dwarffs-0.1.${substring 0 8 deps.self.lastModified}";

produces a name like dwarffs-0.1.20190528.

It's also visible in nix flake info:

$ nix flake info nixpkgs
ID:            nixpkgs
...
Revision:      a4d896e89932e873c4117908d558db6210fa3b56
Last modified: 2019-04-19 14:48:40

@edolstra edolstra requested a review from CSVdB May 28, 2019 20:40
@edolstra edolstra changed the base branch from source-info to flakes May 29, 2019 08:09
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.
@edolstra edolstra merged commit 315f198 into flakes May 29, 2019
@edolstra edolstra deleted the last-modified branch May 29, 2019 08:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant