mirror of
https://github.com/nix-community/nix-direnv.git
synced 2025-11-08 19:46:11 +01:00
test_gc: force change of env by passing arg to shell.nix
This commit is contained in:
parent
64c2b7bff7
commit
db0e37ea65
2 changed files with 7 additions and 12 deletions
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -1,14 +1,11 @@
|
|||
{ pkgs ? import <nixpkgs> {}, someArg ? null }:
|
||||
pkgs.mkShellNoCC {
|
||||
nativeBuildInputs = [ pkgs.hello ];
|
||||
shellHook = ''
|
||||
{ pkgs ? import <nixpkgs> { }, someArg ? null, shellHook ? ''
|
||||
echo "Executing shellHook."
|
||||
'';
|
||||
'' }:
|
||||
pkgs.mkShellNoCC {
|
||||
inherit shellHook;
|
||||
|
||||
nativeBuildInputs = [ pkgs.hello ];
|
||||
SHOULD_BE_SET = someArg;
|
||||
|
||||
passthru = {
|
||||
subshell = pkgs.mkShellNoCC {
|
||||
THIS_IS_A_SUBSHELL = "OK";
|
||||
};
|
||||
};
|
||||
passthru = { subshell = pkgs.mkShellNoCC { THIS_IS_A_SUBSHELL = "OK"; }; };
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue