From 998e70eb824ad70386b8c1ae1f7461b95938adcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joaqu=C3=ADn=20Tri=C3=B1anes?= Date: Mon, 18 Dec 2023 03:02:00 +0100 Subject: [PATCH] direnv: Use ${getExe pkg} instead of ${pkg}/bin/pkg --- modules/programs/direnv.nix | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/programs/direnv.nix b/modules/programs/direnv.nix index 308a7ef3d..3ed5fdf16 100644 --- a/modules/programs/direnv.nix +++ b/modules/programs/direnv.nix @@ -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 }