-
-
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
Flake falsely assumes the store path. #4081
Comments
As a workaround you can use the nix build --option store ./test-store nixpkgs#hello which will fail with an |
on a related note, the out link for local stores also appears to be wrong, likely for the same reason.. |
Yes, if you try to use the external store, the result link is still |
Suggestion: maybe rename this issue to something like "local stores don't work in pure evaluation mode" or "invalid path error with local store"? |
Well, but I do think this issue is related to other references to the store in the codebase because nix is getting wrong store paths in several occasions as I described above. |
Not sure if this issue is getting as much attention as it should.. @edolstra are you aware of this? |
I think the issue is the evaluation cache writing down paths. One thing I did in #3754 is is make it write down "store path descriptors" (hashes and references used to write the store path) instead of the store path itself. This means a store path can be computed from that from any store dir. |
Any updates on this? I got past the original "fetched file isn't in nix store" by using the latest master and setting the store to Update: It turns out that the files themselves are there, but can't be run for some reason. |
If I am not mistaken 4badb69 fixes part of this. |
I can rebuild my spare system with the latest master and report back on whether that still occurs or not, if you wish? |
@xaverdh Well that didn't work, though I'm not sure I did it properly to begin with; how do I use the master branch of the Nix repo in my flake? |
Never mind; I figured out how to use the master branch, but now I'm getting stuck on |
@xaverdh So I can use absolute paths everywhere? Edit: never mind. Same problem of the file not being found. |
Any updates on this, if I may ask? |
May I ask if there are any updates on this again? I am currently attempting to initialize a new system with the flake, but am getting the same errors as above. Should I just create a smaller configuration without flakes to initialize the new system in the meantime? |
FWIW, I also ran into the same issue. Thanks to a pointer on IRC from @colemickens, I was able to get a fresh, flakes-based install up and running.
|
I marked this as stale due to inactivity. → More info |
still important to me |
Detailed logs are in NixOS/nixpkgs#126141 (comment) |
I had to use solution from @cole-h 's comment today while setting up my Raspberry Pi. The error message is not very helpful, and the solution is not obvious. Fix does become semi-obvious in hindsight, but it is a UX gap, and might be worth fixing. |
Describe the bug
Recently, I have been trying to install my full configuration in flake at once from NixOS LiveCD. To achieve that, I have to use the store on the target drive instead of that on tmpfs or OverlayFS.
However, even if I apply
--option store /mnt
,nix
sometimes still uses/nix/store
instead of/mnt/nix/store
to check and eval.Steps To Reproduce
nix build "${MOUNTPOINT}/etc/nixos#name" --option store ${MOUNTPOINT}
Above would throw error like
To get around it, I have to
nix copy --to /mnt nixpkgs#nixFlakes --no-check-sigs
(without--no-check-sigs
it doesn't work on LiveCD, despite normal behavior on an ordinary NixOS).After
nix copy
, run abovenix build
again gives me complaints about absence offlake.nix
(I guess this is becausenix
archived the/mnt/etc/nixos
to/mnt/nix/store
, but still checked presence offlake.nix
in/nix/store
).If I manually
nix archive
it, and runnix build
again, it will throw error about impurity.which I guess is caused by
nix
thinking/mnt/nix/store
is not the store (anything other than/nix/store
is not allowed then).Expected behavior
Use
/mnt/nix/store
for all occasions.nix-env --version
outputnix-env (Nix) 3.0pre20200829_f156513
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: