-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Nix doesn't use the flake inputs #3769
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
Comments
I don't see it as a bug, but as an expected behavior. I think this behavior would confuse if running |
I agree, but it would be nice to have some syntax to use a flake input from another flake. |
Here's an idea: we could have a flag that overrides the registry using the lock file entries from the specified flake. E.g.
I.e. the registry entry for This could have other uses, like copying lock file entries from another flake (e.g. |
I like that idea. This would also allow me to write a wrapper script that can search-up for the flake.lock file so that |
That should probably work without any wrapper scripts... |
This allows you to refer to an input from another flake. For example, $ nix run --inputs-from /path/to/hydra nixpkgs#hello runs 'hello' from the 'nixpkgs' inputs of the 'hydra' flake. Fixes #3769.
Describe the bug
When running
nix shell nixpkgs#hello
in a repository that contains aflake.nix
andflake.lock
files, I would expect Nix to use the version of nixpkgs that is specified in the lock file. Instead, it sources it from the latest registry version.This means that every time the flake TTL is reached, Nix will try and pull the latest registry and maybe get a different version of the package. I would prefer if I was able to pin and control when that version gets updated for a particular project.
Workaround
It's possible to re-export nixpkgs in the flake and then access it, for example with
nix shell .#nixpkgs.hello
.While this is possible, I think that it would be more convenient to get access to the underlying inputs directly. That will make debugging easier for example.
nix-env --version
outputThe text was updated successfully, but these errors were encountered: