Skip to content
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] nix flake init failed with ~/.local/share/nix/root used as a chroot store #6853

Open
augu5te opened this issue Aug 2, 2022 · 3 comments
Labels

Comments

@augu5te
Copy link

augu5te commented Aug 2, 2022

Describe the bug

When ~/.local/share/nix/root is used as a chroot store, template's source is not found despite it being present in the store.

[root@tmp:~]# nix --extra-experimental-features 'flakes nix-command' flake init
error: '/home/orichard/.local/share/nix/root/nix/store/kgr2zyykdhyck7wx14x2pmnx0bl49hgs-source/trivial' was not found in the Nix store
       If you've set 'defaultTemplate.path' to a string, try using a path instead.

[root@tmp:~]# ls /home/orichard/.local/share/nix/root/nix/store/kgr2zyykdhyck7wx14x2pmnx0bl49hgs-source/trivial
flake.nix

Steps To Reproduce

  1. Build nix-static to simplify test on machine without nix and nix store
    nix build "github:NixOS/nix/0b62dab6db3da5b20e62697b14aaaf80f1a2eea6#packages.x86_64-linux.nix-static"
  2. Copy `result/bin/nix on machine without nix
  3. On this machine execute ./nix --extra-experimental-features 'flakes nix-command' flake init

Expected behavior
Copy flake.nix from trivial template in current directory.

Tested with:
nix (Nix) 2.10.3

@augu5te augu5te added the bug label Aug 2, 2022
@edolstra
Copy link
Member

edolstra commented Aug 2, 2022

This is fixed by #6530.

@tuffnerdstuff
Copy link

Same problem still present on nix (Nix) 2.22.1

@chaserhkj
Copy link

Confirm same problem still present on nix (Nix) 2.23.0pre20240510_87ab3c0

nix profile seems to have similar problem too:

[user@e36842965c86 ~]$ ./nix --extra-experimental-features 'flakes nix-command' profile install nixpkgs#hello
error: filesystem error: directory iterator cannot open directory: No such file or directory [/nix/store/bw9z0jxp5qcm7jfp4vr6ci9qynjyaaip-hello-2.12.1]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants