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..
4#
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.
9
10self: # from the flake
11
12finalLib: prevLib: # lib overlay
13
14{
15 trivial = prevLib.trivial // {
16 versionSuffix = ".${
17 finalLib.substring 0 8 (self.lastModifiedDate or "19700101")
18 }.${self.shortRev or "dirty"}";
19 revisionWithDefault = default: self.rev or default;
20 };
21}