From f2b5bf55aa439a6c517adfcb9715a5a952020c5f Mon Sep 17 00:00:00 2001 From: Kira <67888720+koffydrop@users.noreply.github.com> Date: Fri, 9 May 2025 10:23:08 -0300 Subject: [PATCH] direnv: update nushell env conversion logic (#6999) Direnv exports PATH as a string, nu expects it to be a list and breaks some functionality like external command completion. This requires nushell 0.104.0, which is merged into nixpkgs-unstable. --- modules/programs/direnv.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/programs/direnv.nix b/modules/programs/direnv.nix index eb9dde52..49d074df 100644 --- a/modules/programs/direnv.nix +++ b/modules/programs/direnv.nix @@ -175,6 +175,7 @@ in # Using mkAfter to make it more likely to appear after other # manipulations of the prompt. programs.nushell.extraConfig = mkIf cfg.enableNushellIntegration (mkAfter '' + use std/config env-conversions $env.config = ($env.config? | default {}) $env.config.hooks = ($env.config.hooks? | default {}) $env.config.hooks.pre_prompt = ( @@ -186,8 +187,8 @@ in | default {} | items {|key, value| let value = do ( - $env.ENV_CONVERSIONS? - | default {} + { PATH: (env-conversions).path } + | merge ($env.ENV_CONVERSIONS? | default {}) | get -i $key | get -i from_string | default {|x| $x} @@ -198,6 +199,7 @@ in | load-env } ) + hide env-conversions ''); home.sessionVariables = lib.mkIf (cfg.silent && !isVersion236orHigher) { DIRENV_LOG_FORMAT = ""; };