This commit is contained in:
Schrottkatze 2023-10-28 22:25:06 +02:00
commit 1cd19687be
21 changed files with 315 additions and 68 deletions

View file

@ -247,9 +247,21 @@ $env.config = {
hooks: {
pre_prompt: [{ ||
let direnv = (direnv export json | from json)
let direnv = if ($direnv | length) == 1 { $direnv } else { {} }
$direnv | load-env
let direnv = (direnv export json | from json | default {})
if ($direnv | is-empty) {
return
}
$direnv
| items {|key, value|
{
key: $key
value: (if $key in $env.ENV_CONVERSIONS {
do ($env.ENV_CONVERSIONS | get $key | get from_string) $value
} else {
$value
})
}
} | transpose -ird | load-env
}] # run before the prompt is shown
pre_execution: [{ null }] # run before the repl input is run
env_change: {
@ -793,3 +805,5 @@ start_zellij
alias gnix = cd ~/nix-configs;
alias grepo = cd ~/Documents/repos;
alias wh = wormhole-rs;
alias nix-shell = nix-shell --run 'nu -li';
alias nsp = nix-shell --run 'nu -li' -p;