Skip to content

nix-shell -p is too magical #726

@copumpkin

Description

@copumpkin

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?

Metadata

Metadata

Assignees

Labels

No labels
No labels
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions