Open wmertens opened 3 years ago
Describe the bug
When trying to use a channel that's only in a provided root, nix-build is confused.
I think the evaluation needs to happen with the store pointing to the given --root.
Steps to reproduce
[root@stratokit-nixos-iso:~]# nixos-install --root /mnt --channel nixpkgs=https://releases.nixos.org/nixos/21.05/nixos-21.05.1240.71326cd12dd/nixexprs.tar.xz --no-channel-copy --show-trace building the configuration in /mnt/etc/nixos/configuration.nix... error: opening file '/nix/store/gfzhl0r80gnii61fhxqy7vfwzhrymx5g-nixexprs.tar.xz': No such file or directory [root@stratokit-nixos-iso:~]# ll /nix/store/gf* ls: cannot access '/nix/store/gf*': No such file or directory [root@stratokit-nixos-iso:~]# ll /mnt/nix/store/gf* -rw-r--r-- 1 root root 18293440 Jul 30 13:21 /mnt/nix/store/gfzhl0r80gnii61fhxqy7vfwzhrymx5g-nixexprs.tar.xz -rw------- 1 root root 0 Jul 30 13:18 /mnt/nix/store/gfzhl0r80gnii61fhxqy7vfwzhrymx5g-nixexprs.tar.xz.lock
In particular, the reason is nix-build:
[root@stratokit-nixos-iso:~]# sh -xv /run/current-system/sw/bin/nixos-install --root /mnt --channel nixpkgs=https://releases.nixos.org/nixos/21.05/nixos-21.05.1240.71326cd12dd/nixexprs.tar.xz --no-channel-copy --show-trace [...] + nix-build --out-link /mnt/tmp.qoKo7OmTa3/system --store /mnt --show-trace --extra-substituters 'auto?trusted=1' '<nixpkgs/nixos>' -A system -I nixos-config=/mnt/etc/nixos/configuration.nix
I can make it work by not passing a channel and instead use the one the CD was built with:
# NIX_PATH=nixpkgs=/root/.nix-defexpr/channels/nixos sh -xv /run/current-system/sw/bin/nixos-install --root /mnt --no-channel-copy --show-trace
And I can also work around it by prefetching the channel:
[root@stratokit-nixos-iso:~]# nix-prefetch-url https://releases.nixos.org/nixos/21.05/nixos-21.05.1240.71326cd12dd/nixexprs.tar.xz [17.4 MiB DL] path is '/nix/store/gfzhl0r80gnii61fhxqy7vfwzhrymx5g-nixexprs.tar.xz' 1css7s7jkj2dnzbldlkab61fmwgzm7djg9w8dkvky4hgw1j3qm6x [root@stratokit-nixos-iso:~]# nixos-install --root /mnt --channel nixpkgs=https://releases.nixos.org/nixos/21.05/nixos-21.05.1240.71326cd12dd/nixexprs.tar.xz --no-channel-copy --show-trace building the configuration in /mnt/etc/nixos/configuration.nix... [...works]
nix-env --version output
nix-env --version
nix-env (Nix) 2.3.12
I marked this as stale due to inactivity. → More info
Describe the bug
When trying to use a channel that's only in a provided root, nix-build is confused.
I think the evaluation needs to happen with the store pointing to the given --root.
Steps to reproduce
In particular, the reason is nix-build:
I can make it work by not passing a channel and instead use the one the CD was built with:
And I can also work around it by prefetching the channel:
nix-env --version
outputnix-env (Nix) 2.3.12