mirror of
https://github.com/NixOS/nix
synced 2025-07-07 01:51:47 +02:00
nix-shell -p: pass --arg values as nixpkgs params
This commit is contained in:
parent
2b67cb7b8c
commit
6eeb6f9c84
3 changed files with 7 additions and 3 deletions
|
@ -54,6 +54,10 @@ nix-instantiate shell.nix -A shellDrv --add-root $TEST_ROOT/shell
|
|||
output=$(NIX_PATH=nixpkgs=shell.nix nix-shell --pure -p foo bar --run 'echo "$(foo) $(bar)"')
|
||||
[ "$output" = "foo bar" ]
|
||||
|
||||
# Test nix-shell -p --arg x y
|
||||
output=$(NIX_PATH=nixpkgs=shell.nix nix-shell --pure -p foo --argstr fooContents baz --run 'echo "$(foo)"')
|
||||
[ "$output" = "baz" ]
|
||||
|
||||
# Test nix-shell shebang mode
|
||||
sed -e "s|@ENV_PROG@|$(type -P env)|" shell.shebang.sh > $TEST_ROOT/shell.shebang.sh
|
||||
chmod a+rx $TEST_ROOT/shell.shebang.sh
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue