mirror of
https://github.com/nix-community/home-manager.git
synced 2025-12-09 18:41:06 +01:00
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.
This commit is contained in:
parent
3be7c80a11
commit
f2b5bf55aa
1 changed files with 4 additions and 2 deletions
|
|
@ -175,6 +175,7 @@ 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.
|
||||||
programs.nushell.extraConfig = mkIf cfg.enableNushellIntegration (mkAfter ''
|
programs.nushell.extraConfig = mkIf cfg.enableNushellIntegration (mkAfter ''
|
||||||
|
use std/config env-conversions
|
||||||
$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 = (
|
||||||
|
|
@ -186,8 +187,8 @@ in
|
||||||
| default {}
|
| default {}
|
||||||
| items {|key, value|
|
| items {|key, value|
|
||||||
let value = do (
|
let value = do (
|
||||||
$env.ENV_CONVERSIONS?
|
{ PATH: (env-conversions).path }
|
||||||
| default {}
|
| merge ($env.ENV_CONVERSIONS? | default {})
|
||||||
| get -i $key
|
| get -i $key
|
||||||
| get -i from_string
|
| get -i from_string
|
||||||
| default {|x| $x}
|
| default {|x| $x}
|
||||||
|
|
@ -198,6 +199,7 @@ in
|
||||||
| load-env
|
| load-env
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
hide env-conversions
|
||||||
'');
|
'');
|
||||||
|
|
||||||
home.sessionVariables = lib.mkIf (cfg.silent && !isVersion236orHigher) { DIRENV_LOG_FORMAT = ""; };
|
home.sessionVariables = lib.mkIf (cfg.silent && !isVersion236orHigher) { DIRENV_LOG_FORMAT = ""; };
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue