1 # This function produces a lib overlay to be used by the nixpkgs
2 # & nixpkgs/lib flakes to provide meaningful values for
3 # `lib.trivial.version` et al..
5 # Internal and subject to change, don't use this anywhere else!
6 # Instead, consider using a public interface, such as this flake here
7 # in this directory, `lib/`, or use the nixpkgs flake, which applies
8 # this logic for you in its `lib` output attribute.
10 self: # from the flake
12 finalLib: prevLib: # lib overlay
15 trivial = prevLib.trivial // {
17 ".${finalLib.substring 0 8 (self.lastModifiedDate or "19700101")}.${self.shortRev or "dirty"}";
18 revisionWithDefault = default: self.rev or default;