`nix-shell` fails
Closed this issue · 2 comments
MIJOTHY commented
Nice library. I'm enjoying using it, but I'd like to play around with it a bit. Unfortunately, running nix-shell --verbose
results in the following error:
evaluating file '/nix/store/k21q9k2bmb7qj2kq6md0xgs8d274nvws-nix-2.2/share/nix/corepkgs/derivation.nix'
evaluating file '/home/james/coding/projects/capability/nix/default.nix'
evaluating file '/home/james/coding/projects/capability/nix/nixpkgs/default.nix'
evaluating file '/nix/store/k21q9k2bmb7qj2kq6md0xgs8d274nvws-nix-2.2/share/nix/corepkgs/fetchurl.nix'
evaluating file '/nix/store/k21q9k2bmb7qj2kq6md0xgs8d274nvws-nix-2.2/share/nix/corepkgs/config.nix'
building '/nix/store/afh5rs4gk1jrsm6li8jgik0790bkg98f-89b618771ad4b0cfdb874dee3d51eb267c4257dd.tar.gz-unpacked.drv'...
while setting up the build environment: executing '/nix/store/cinw572b38aln37glr0zb8lxwrgaffl4-bash-4.4-p23/bin/bash': No such file or directory
builder for '/nix/store/afh5rs4gk1jrsm6li8jgik0790bkg98f-89b618771ad4b0cfdb874dee3d51eb267c4257dd.tar.gz-unpacked.drv' failed with exit code 1
error: build of '/nix/store/afh5rs4gk1jrsm6li8jgik0790bkg98f-89b618771ad4b0cfdb874dee3d51eb267c4257dd.tar.gz-unpacked.drv' failed
According to a post in the link in nix/nixpkgs/default.nix (NixOS/nixpkgs#30399 (comment)), using builder = nixcfg.shell;
"works ... because of the /bin/sh Nix impurity", and seems to be the source of my issue.
I see two ways of fixing this:
- Change the line to
builder = builtins.storePath nixcfg.shell;
. - Use the nix2 idiomatic way of pinning nixpkgs.
I'm happy to do either of these and PR.
Cheers
MIJOTHY commented
Alternatively if you still want to support pre-1.12, I can implement https://nixos.wiki/wiki/How_to_fetch_Nixpkgs_with_an_empty_NIX_PATH