mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-11 20:25:32 +03:00
direnv: fix indentation of generated scripts
This commit is contained in:
parent
6f9a8cf293
commit
b7b2c7cb02
1 changed files with 14 additions and 15 deletions
|
@ -119,7 +119,7 @@ in
|
||||||
|
|
||||||
zsh.interactiveShellInit = lib.mkIf cfg.enableZshIntegration ''
|
zsh.interactiveShellInit = lib.mkIf cfg.enableZshIntegration ''
|
||||||
if ${lib.boolToString cfg.loadInNixShell} || printenv PATH | grep -vqc '/nix/store'; then
|
if ${lib.boolToString cfg.loadInNixShell} || printenv PATH | grep -vqc '/nix/store'; then
|
||||||
eval "$(${lib.getExe cfg.finalPackage} hook zsh)"
|
eval "$(${lib.getExe cfg.finalPackage} hook zsh)"
|
||||||
fi
|
fi
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
@ -127,14 +127,13 @@ in
|
||||||
#$IN_NIX_SHELL for "nix-shell"
|
#$IN_NIX_SHELL for "nix-shell"
|
||||||
bash.interactiveShellInit = lib.mkIf cfg.enableBashIntegration ''
|
bash.interactiveShellInit = lib.mkIf cfg.enableBashIntegration ''
|
||||||
if ${lib.boolToString cfg.loadInNixShell} || [ -z "$IN_NIX_SHELL$NIX_GCROOT$(printenv PATH | grep '/nix/store')" ] ; then
|
if ${lib.boolToString cfg.loadInNixShell} || [ -z "$IN_NIX_SHELL$NIX_GCROOT$(printenv PATH | grep '/nix/store')" ] ; then
|
||||||
eval "$(${lib.getExe cfg.finalPackage} hook bash)"
|
eval "$(${lib.getExe cfg.finalPackage} hook bash)"
|
||||||
fi
|
fi
|
||||||
'';
|
'';
|
||||||
|
|
||||||
fish.interactiveShellInit = lib.mkIf cfg.enableFishIntegration ''
|
fish.interactiveShellInit = lib.mkIf cfg.enableFishIntegration ''
|
||||||
if ${lib.boolToString cfg.loadInNixShell};
|
if ${lib.boolToString cfg.loadInNixShell}; or printenv PATH | grep -vqc '/nix/store';
|
||||||
or printenv PATH | grep -vqc '/nix/store';
|
${lib.getExe cfg.finalPackage} hook fish | source
|
||||||
${lib.getExe cfg.finalPackage} hook fish | source
|
|
||||||
end
|
end
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
@ -169,18 +168,18 @@ in
|
||||||
source ${cfg.nix-direnv.package}/share/nix-direnv/direnvrc
|
source ${cfg.nix-direnv.package}/share/nix-direnv/direnvrc
|
||||||
''}
|
''}
|
||||||
|
|
||||||
#Load direnvrcExtra
|
#Load direnvrcExtra
|
||||||
${cfg.direnvrcExtra}
|
${cfg.direnvrcExtra}
|
||||||
|
|
||||||
#Load user-configuration if present (~/.direnvrc or ~/.config/direnv/direnvrc)
|
#Load user-configuration if present (~/.direnvrc or ~/.config/direnv/direnvrc)
|
||||||
direnv_config_dir_home="''${DIRENV_CONFIG_HOME:-''${XDG_CONFIG_HOME:-$HOME/.config}/direnv}"
|
direnv_config_dir_home="''${DIRENV_CONFIG_HOME:-''${XDG_CONFIG_HOME:-$HOME/.config}/direnv}"
|
||||||
if [[ -f $direnv_config_dir_home/direnvrc ]]; then
|
if [[ -f $direnv_config_dir_home/direnvrc ]]; then
|
||||||
source "$direnv_config_dir_home/direnvrc" >&2
|
source "$direnv_config_dir_home/direnvrc" >&2
|
||||||
elif [[ -f $HOME/.direnvrc ]]; then
|
elif [[ -f $HOME/.direnvrc ]]; then
|
||||||
source "$HOME/.direnvrc" >&2
|
source "$HOME/.direnvrc" >&2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
unset direnv_config_dir_home
|
unset direnv_config_dir_home
|
||||||
'';
|
'';
|
||||||
|
|
||||||
"direnv/lib/zz-user.sh".text = ''
|
"direnv/lib/zz-user.sh".text = ''
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue