mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-06 13:53:05 +00:00
ede5720a0d
* Improves the comments of `lib/flake-version-info.nix` and drops the `__`-prefix from the filename. * `lib'` -> `lib0` in `nixpkgs/lib`. * Drop the declaration of `trivial.version` in the overlay because this declaration already uses the final expressions of `versionSuffix` and `release` now. * No need to fall back to `self.lastModified` anymore, this was a workaround for pre2.4 Nix. Co-authored-by: Robert Hensing <robert@roberthensing.nl> Co-authored-by: Silvan Mosberger <contact@infinisil.com>
21 lines
689 B
Nix
21 lines
689 B
Nix
# This function produces a lib overlay to be used by the nixpkgs
|
|
# & nixpkgs/lib flakes to provide meaningful values for
|
|
# `lib.trivial.version` et al..
|
|
#
|
|
# Internal and subject to change, don't use this anywhere else!
|
|
# Instead, consider using a public interface, such as this flake here
|
|
# in this directory, `lib/`, or use the nixpkgs flake, which applies
|
|
# this logic for you in its `lib` output attribute.
|
|
|
|
self: # from the flake
|
|
|
|
finalLib: prevLib: # lib overlay
|
|
|
|
{
|
|
trivial = prevLib.trivial // {
|
|
versionSuffix =
|
|
".${finalLib.substring 0 8 (self.lastModifiedDate or "19700101")}.${self.shortRev or "dirty"}";
|
|
revisionWithDefault = default: self.rev or default;
|
|
};
|
|
}
|