-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Allow getFlake
of in-store paths in pure mode.
#6353
Comments
A little more clarity with further thought: |
A The options available seem to be:
Added later: another way to think about it. An inputs block is clearly interpreted in the context of a flake and so there is a parent in the context, but a builtins.getFlake may be called from anywhere, therefore there may be no parent at all. |
I ended up here because I tried to do
should behave the same as
I don't really understand the discussion about locking or flake inputs, pardon my ignorance. |
I just wanted to come back to this. It seems like this actually might be a nice interface for "private" flake inputs. As in, I want to keep my top-level flake.nix API clean and up to some standard, while maybe somewhere deep in some Nix file I just need a one-off module from some flake that isn't really related to the top-level project in any direct sense. Some flakes currently do not implement a "default.nix" compatibility layer so there may be no way to access this resource except via it's flake API; yet I don't really want to convolute the flake.nix with "ad-hoc" dependencies. Tangentially related, this may also help avoid a mass buildup of inputs in the lock file leading eventually to #6626 (though I would hope a solution for that would emerge independantly, eventually) For implementation, we could modify the API of edit |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: |
Is your feature request related to a problem? Please describe.
flake.nix
:child/flake.nix
:But it isn't actually "mutable"... reproducibility isn't lost here.
Describe the solution you'd like
Nix should be aware that the source path of the flake is in fact immutable, locked by its inclusion in the parent flake, and allow it in pure mode.
Describe alternatives you've considered
Specifying a hash would get around this, but would suffer from the update problems of #6352.
Additional context
This originally came up in the context of creating tests for flake templates which are distributed as subflakes of a parent flake.
The text was updated successfully, but these errors were encountered: