-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathenv.nu
More file actions
50 lines (45 loc) · 1.33 KB
/
env.nu
File metadata and controls
50 lines (45 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# env.nu
#
# Installed by:
# version = "0.108.0"
#
# Previously, environment variables were typically configured in `env.nu`.
# In general, most configuration can and should be performed in `config.nu`
# or one of the autoload directories.
#
# This file is generated for backwards compatibility for now.
# It is loaded before config.nu and login.nu
#
# See https://www.nushell.sh/book/configuration.html
#
# Also see `help config env` for more options.
#
# You can remove these comments if you want or leave
# them for future reference.
# ssh-agent
do --env {
let ssh_agent_file = (
$nu.temp-path | path join $"ssh-agent-(whoami).nuon"
)
if ($ssh_agent_file | path exists) {
let ssh_agent_env = open ($ssh_agent_file)
if ($"/proc/($ssh_agent_env.SSH_AGENT_PID)" | path exists) {
load-env $ssh_agent_env
return
} else {
rm $ssh_agent_file
}
}
let ssh_agent_env = ^ssh-agent -c
| lines
| first 2
| parse "setenv {name} {value};"
| transpose --header-row
| into record
load-env $ssh_agent_env
$ssh_agent_env | save --force $ssh_agent_file
}
# carapace
$env.CARAPACE_BRIDGES = 'zsh,fish,bash,inshellisense' # optional
mkdir $"($nu.cache-dir)"
carapace _carapace nushell | save --force $"($nu.cache-dir)/carapace.nu"