-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add parseFlakeRef
and flakeRefToString
builtins
#8670
Add parseFlakeRef
and flakeRefToString
builtins
#8670
Conversation
@edolstra bump 鉂わ笍 |
parseFlakeRef
and flakeRefToString
builtins
Co-authored-by: Eelco Dolstra <edolstra@gmail.com>
Co-authored-by: Eelco Dolstra <edolstra@gmail.com>
Co-authored-by: Eelco Dolstra <edolstra@gmail.com>
Co-authored-by: Eelco Dolstra <edolstra@gmail.com>
Co-authored-by: Eelco Dolstra <edolstra@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With those docs changes
(we don't really worry about line length in the multiline strings, but rather try to use 1 sentance per line.)
and the release notes conflicts fixed (because 2.17 was just cut) this is good!
Co-authored-by: John Ericson <git@JohnEricson.me>
Co-authored-by: John Ericson <git@JohnEricson.me>
parseFlakeRef
and flakeRefToString
builtinsparseFlakeRef
and flakeRefToString
builtins
note the release notes still have a conflict, because 2.17 was just released. |
Got that conflict resolve and merged the provided doc changes ( thanks for tweaking those ). |
Coming a bit late, but from the 2023-07-24 Nix maintainers meeting: Approved on the principle, assigned to @Ericson2314 |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/2023-07-24-nix-team-meeting-minutes-74/31116/1 |
Motivation
Over the last year or so I've run into several use cases where I need to parse and/or serialize URLs for use by
builtins.fetchTree
orbuiltins.getFlake
, largely in order to produce lockfile-like files for lang2nix frameworks or tools which usenix
internally to drive builds.I've gone through the painstaking process of emulating
nix::FlakeRef::fromAttrs
andnix::parseFlakeRef
several times with mixed success; but these are difficult to create and even harder to maintain if I hope to stay aligned with changes to the real parser/serializer.Context
I understand why adding new
builtins
isn't something we want to do flagrantly. I'm recommending this addition simply because I keep encountering use cases where I need to parse/serialize these URIs innix
expressions, and I want a reliable solution.Checklist for maintainers
Maintainers: tick if completed or explain if not relevant
tests/**.sh
src/*/tests
tests/nixos/*
Priorities
Add 馃憤 to pull requests you find important.