1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-07 18:31:49 +02:00

Merge pull request #6664 from Ma27/innixshell-backwards-compat

nix-shell: restore backwards-compat with old nixpkgs
This commit is contained in:
Théophane Hufschmitt 2022-07-05 15:57:20 +02:00 committed by GitHub
commit d63cd77549
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 43 additions and 5 deletions

View file

@ -1 +1 @@
{ ... }@args: import ./shell.nix (args // { contentAddressed = true; })
{ inNixShell ? false, ... }@args: import ./shell.nix (args // { contentAddressed = true; })

View file

@ -102,3 +102,11 @@ source <(nix print-dev-env -f "$shellDotNix" shellDrv)
[[ ${arr2[1]} = $'\n' ]]
[[ ${arr2[2]} = $'x\ny' ]]
[[ $(fun) = blabla ]]
# Test nix-shell with ellipsis and no `inNixShell` argument (for backwards compat with old nixpkgs)
cat >$TEST_ROOT/shell-ellipsis.nix <<EOF
{ system ? "x86_64-linux", ... }@args:
assert (!(args ? inNixShell));
(import $shellDotNix { }).shellDrv
EOF
nix-shell $TEST_ROOT/shell-ellipsis.nix --run "true"