-
-
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
Development only flake inputs or different category of inputs #6124
Comments
We cannot have dev-only inputs without dev-only outputs (since we don't want to pass the dev-only inputs to the non-dev outputs). I.e. we would need a |
Thanks to lazy fetching of flake inputs, this issue is less severe than in other package managers such as Cargo. The major remaining annoyance for me when using development or other "private" kinds of inputs is that they are copied to any parent flake's lockfile and printed in commands such as |
I guess it is the point brought up by @Kha that bothers me most as well. If you have a flake that consumes several other flakes and each of these flakes have a lot of "private" inputs, that flake's lockfile can become quite unwieldy. When using a sub-flake the user experience also potentially go down slightly, but it is not too bad. Might just be that I haven't learned about all the sub-flake patterns yet. |
Yeah the usability of subflakes is not very good at the moment, so we need to improve that. |
One way to alleviate this is by allowing Nix 2.7.0 prints the following, despite lock files being present in both directories.
|
Perhaps the design choice of always flattening the lock file could be reconsidered. This might make a solution like #6326 redundant.
This could be resolved with more application of |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/flakes-and-pollution-of-downstream-projects/35411/12 |
Is your feature request related to a problem? Please describe.
When you developing a flake that will be used by other flakes your flake might come with more inputs than the end-user needs.
Several inputs might only be needed during development/testing. Examples:
https://github.com/NixOS/nix/blob/master/flake.nix#L5
Describe the solution you'd like
I'm not sure how to verify that those inputs you use will only be used for devShell, checks or hydraJobs. But I guess when opting out from inputs you would need a way to determine what inputs needs to be pulled in.
Describe alternatives you've considered
Creating multiple standalone flakes, e.g. one flake in a folder named devshell, another flake in a folder named tests. But unfortunately that makes the main flake not supporting the
nix develop
andnix flake check
commands.The text was updated successfully, but these errors were encountered: