diff --git a/tests/test_gc.py b/tests/test_gc.py index e93a18c..12240b6 100644 --- a/tests/test_gc.py +++ b/tests/test_gc.py @@ -64,8 +64,7 @@ def test_use_nix(direnv_project: DirenvProject) -> None: direnv_project.setup_envrc("use nix") common_test(direnv_project) - # --pure here is just a way to make sure the environment changes - direnv_project.setup_envrc("use nix --pure") + direnv_project.setup_envrc("use nix --argstr 'echo Executing hijacked shellHook.'") common_test_clean(direnv_project) @@ -81,7 +80,6 @@ def test_use_flake(direnv_project: DirenvProject) -> None: for symlink in inputs: assert symlink.is_dir() - # --impure here is just a way to make sure the environment changes direnv_project.setup_envrc("use flake --impure") common_test_clean(direnv_project) diff --git a/tests/testenv/shell.nix b/tests/testenv/shell.nix index c5c9d85..05d0a7a 100644 --- a/tests/testenv/shell.nix +++ b/tests/testenv/shell.nix @@ -1,14 +1,11 @@ -{ pkgs ? import {}, someArg ? null }: +{ pkgs ? import { }, someArg ? null, shellHook ? '' + echo "Executing shellHook." +'' }: pkgs.mkShellNoCC { + inherit shellHook; + nativeBuildInputs = [ pkgs.hello ]; - shellHook = '' - echo "Executing shellHook." - ''; SHOULD_BE_SET = someArg; - passthru = { - subshell = pkgs.mkShellNoCC { - THIS_IS_A_SUBSHELL = "OK"; - }; - }; + passthru = { subshell = pkgs.mkShellNoCC { THIS_IS_A_SUBSHELL = "OK"; }; }; }