mirror of
https://github.com/nix-community/home-manager
synced 2024-11-10 21:29:48 +01:00
direnv: Use ${getExe pkg} instead of ${pkg}/bin/pkg
This commit is contained in:
parent
63d6e2de24
commit
998e70eb82
1 changed files with 6 additions and 4 deletions
|
@ -114,18 +114,18 @@ in {
|
||||||
# Using mkAfter to make it more likely to appear after other
|
# Using mkAfter to make it more likely to appear after other
|
||||||
# manipulations of the prompt.
|
# manipulations of the prompt.
|
||||||
mkAfter ''
|
mkAfter ''
|
||||||
eval "$(${cfg.package}/bin/direnv hook bash)"
|
eval "$(${getExe cfg.package} hook bash)"
|
||||||
'');
|
'');
|
||||||
|
|
||||||
programs.zsh.initExtra = mkIf cfg.enableZshIntegration ''
|
programs.zsh.initExtra = mkIf cfg.enableZshIntegration ''
|
||||||
eval "$(${cfg.package}/bin/direnv hook zsh)"
|
eval "$(${getExe cfg.package} hook zsh)"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
programs.fish.interactiveShellInit = mkIf cfg.enableFishIntegration (
|
programs.fish.interactiveShellInit = mkIf cfg.enableFishIntegration (
|
||||||
# Using mkAfter to make it more likely to appear after other
|
# Using mkAfter to make it more likely to appear after other
|
||||||
# manipulations of the prompt.
|
# manipulations of the prompt.
|
||||||
mkAfter ''
|
mkAfter ''
|
||||||
${cfg.package}/bin/direnv hook fish | source
|
${getExe cfg.package} hook fish | source
|
||||||
'');
|
'');
|
||||||
|
|
||||||
programs.nushell.extraConfig = mkIf cfg.enableNushellIntegration (
|
programs.nushell.extraConfig = mkIf cfg.enableNushellIntegration (
|
||||||
|
@ -135,7 +135,9 @@ in {
|
||||||
$env.config = ($env.config? | default {})
|
$env.config = ($env.config? | default {})
|
||||||
$env.config.hooks = ($env.config.hooks? | default {})
|
$env.config.hooks = ($env.config.hooks? | default {})
|
||||||
$env.config.hooks.pre_prompt = ($env.config.hooks.pre_prompt? | default [] | append {||
|
$env.config.hooks.pre_prompt = ($env.config.hooks.pre_prompt? | default [] | append {||
|
||||||
let direnv = (${cfg.package}/bin/direnv export json | from json | default {})
|
let direnv = (${
|
||||||
|
getExe cfg.package
|
||||||
|
} export json | from json | default {})
|
||||||
if ($direnv | is-empty) {
|
if ($direnv | is-empty) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue