Configure direnv for nushell

This commit is contained in:
Nathan McCarty 2024-11-29 22:26:53 +00:00
parent e8df479f12
commit d3138a5093

View file

@ -18,5 +18,22 @@
];
programs = {
direnv.enable = true;
# Configure direnv with nushell
programs.nushell.extraConfig = ''
$env.config = {
hooks: {
pre_prompt: [{ ||
if (which direnv | is-empty) {
return
}
direnv export json | from json | default {} | load-env
if 'ENV_CONVERSIONS' in $env and 'PATH' in $env.ENV_CONVERSIONS {
$env.PATH = do $env.ENV_CONVERSIONS.PATH.from_string $env.PATH
}
}]
}
}
'';
};
}