1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-09-21 05:47:29 +02:00

direnv: Use ${getExe pkg} instead of ${pkg}/bin/pkg

This commit is contained in:
Joaquín Triñanes 2023-12-18 03:02:00 +01:00 committed by Mikilio
parent 63d6e2de24
commit 998e70eb82
No known key found for this signature in database
GPG key ID: 5B2F1A890CF33F3F

View file

@ -114,18 +114,18 @@ in {
# Using mkAfter to make it more likely to appear after other
# manipulations of the prompt.
mkAfter ''
eval "$(${cfg.package}/bin/direnv hook bash)"
eval "$(${getExe cfg.package} hook bash)"
'');
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 (
# Using mkAfter to make it more likely to appear after other
# manipulations of the prompt.
mkAfter ''
${cfg.package}/bin/direnv hook fish | source
${getExe cfg.package} hook fish | source
'');
programs.nushell.extraConfig = mkIf cfg.enableNushellIntegration (
@ -135,7 +135,9 @@ in {
$env.config = ($env.config? | default {})
$env.config.hooks = ($env.config.hooks? | default {})
$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) {
return
}