aboutsummaryrefslogtreecommitdiff
path: root/tests/nix-shell.sh
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2023-06-09 13:06:47 +0200
committerGitHub <noreply@github.com>2023-06-09 13:06:47 +0200
commit381a32981bd9d15da2b06f151c38f1a1229a8800 (patch)
tree34bd75c80a91042816d81e4028a5dc8957fd90d9 /tests/nix-shell.sh
parent0e18254aa81b9315c13d6ae736cb38666d19f122 (diff)
parent3c78920f7358957dba37a379e9d0b062dd3192e2 (diff)
Merge branch 'master' into angerman/mac-fix-recursive-nix
Diffstat (limited to 'tests/nix-shell.sh')
-rw-r--r--tests/nix-shell.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/nix-shell.sh b/tests/nix-shell.sh
index 044b96d54..edaa1249b 100644
--- a/tests/nix-shell.sh
+++ b/tests/nix-shell.sh
@@ -98,6 +98,18 @@ nix develop -f "$shellDotNix" shellDrv -c echo foo |& grepQuiet foo
nix print-dev-env -f "$shellDotNix" shellDrv > $TEST_ROOT/dev-env.sh
nix print-dev-env -f "$shellDotNix" shellDrv --json > $TEST_ROOT/dev-env.json
+# Test with raw drv
+
+shellDrv=$(nix-instantiate "$shellDotNix" -A shellDrv.out)
+
+nix develop $shellDrv -c bash -c '[[ -n $stdenv ]]'
+
+nix print-dev-env $shellDrv > $TEST_ROOT/dev-env2.sh
+nix print-dev-env $shellDrv --json > $TEST_ROOT/dev-env2.json
+
+diff $TEST_ROOT/dev-env{,2}.sh
+diff $TEST_ROOT/dev-env{,2}.json
+
# Ensure `nix print-dev-env --json` contains variable assignments.
[[ $(jq -r .variables.arr1.value[2] $TEST_ROOT/dev-env.json) = '3 4' ]]