With nix-shell -A, I can pass it a .nix file to run expressions against, but I can't emulate that behavior easily with nix-shell -p. For example, nix-shell -p foo will install foo in my shell. If I run nix-shell '<nixpkgs>' -A foo, that doesn't give me the same thing. If I want something similar, @puffnfresh on IRC suggested this nasty thing:
nix-shell -E 'with import <nixpkgs> { }; runCommand "ignored" { buildInputs = [ (import ./.).foo ]; } ""'
which doesn't seem great. Can we have an easy way to get behavior like -p without relying on NIX_PATH voodoo or the incantation above?
With
nix-shell -A, I can pass it a .nix file to run expressions against, but I can't emulate that behavior easily withnix-shell -p. For example,nix-shell -p foowill installfooin my shell. If I runnix-shell '<nixpkgs>' -A foo, that doesn't give me the same thing. If I want something similar, @puffnfresh on IRC suggested this nasty thing:which doesn't seem great. Can we have an easy way to get behavior like
-pwithout relying onNIX_PATHvoodoo or the incantation above?