aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorregnat <rg@regnat.ovh>2021-06-11 13:31:19 +0200
committerregnat <rg@regnat.ovh>2021-06-11 13:35:13 +0200
commit2cf591a134f3ec6f634b47eeb522f422c64a9d33 (patch)
treef2adac83df57dfa90fce8980e3aed8ca1306615e /tests
parent56605b468868b834e44a9700907b734428cb120a (diff)
Make `nix develop` work with CA derivations
Fix #4823
Diffstat (limited to 'tests')
-rw-r--r--tests/nix-shell.sh12
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/nix-shell.sh b/tests/nix-shell.sh
index e3174dac1..3481c2c69 100644
--- a/tests/nix-shell.sh
+++ b/tests/nix-shell.sh
@@ -6,6 +6,14 @@ if [[ -n ${CONTENT_ADDRESSED:-} ]]; then
nix-shell () {
command nix-shell --arg contentAddressed true "$@"
}
+
+ nix_develop() {
+ nix develop --arg contentAddressed true "$@"
+ }
+else
+ nix_develop() {
+ nix develop "$@"
+ }
fi
# Test nix-shell -A
@@ -79,13 +87,13 @@ output=$($TEST_ROOT/spaced\ \\\'\"shell.shebang.rb abc ruby)
[ "$output" = '-e load(ARGV.shift) -- '"$TEST_ROOT"'/spaced \'\''"shell.shebang.rb abc ruby' ]
# Test 'nix develop'.
-nix develop -f shell.nix shellDrv -c bash -c '[[ -n $stdenv ]]'
+nix_develop -f shell.nix shellDrv -c bash -c '[[ -n $stdenv ]]'
# Ensure `nix develop -c` preserves stdin
echo foo | nix develop -f shell.nix shellDrv -c cat | grep -q foo
# Ensure `nix develop -c` actually executes the command if stdout isn't a terminal
-nix develop -f shell.nix shellDrv -c echo foo |& grep -q foo
+nix_develop -f shell.nix shellDrv -c echo foo |& grep -q foo
# Test 'nix print-dev-env'.
source <(nix print-dev-env -f shell.nix shellDrv)