-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Add builtins.dateFormat
function
#8163
Comments
Perhaps we should return the whole sourceInfo instead of just a path when |
Cannot find documentation for |
It's an attribute of the |
You can also do something like this for now |
Hmm not bad, though not very explanatory:
|
Another time related "issue" is We might say that time logic is creeping in and we need a better story for it. However, time handling libraries are notoriously hard to implement, suggesting that we'd be better off pinning a nix library such as the Nixpkgs |
|
Oh I see, it's not the |
lastModified/lastModifiedDate/rev/shortRev are just coming from an input's sourceInfo attr |
Here's my take on this in pure Nix: https://github.com/balsoft/Flockenzeit
|
Is your feature request related to a problem? Please describe.
When composing a
flake.nix
, often we need to build a dependency from a flake input that hasflake = false;
. Defining a Nix expression for such a package requires settingpname
andversion
, as always. If one fetches a non release version of this flake input, you may want to set theversion
tounstable-<last-commit-date>
, as we do in Nixpkgs. It's natural to take this date from thelastModified
json key of the input inflake.lock
. However, this json key is an epoch number, and not human readable.Describe the solution you'd like
I think ideally, I could use a pure Nix function as so:
Describe alternatives you've considered
Get this date via:
But this is of course IFD, which is forbidden in restricted mode, and when evaluating packages for commands like
nix search
.The text was updated successfully, but these errors were encountered: