fish: conf.d/setup: Set up all path related things at start

This commit is contained in:
Sanchayan Maity 2023-05-05 10:49:13 +05:30
parent 7779044f67
commit 9363fc249b
Signed by: sanchayanmaity
GPG Key ID: 6F6A0609C12038F3
1 changed files with 17 additions and 18 deletions

View File

@ -1,17 +1,26 @@
function __fish_setup_on_tty_login --description "Set up environment on tty login"
for extra_path in ~/.{local,nix-profile,cargo,cabal,ghcup,go}/bin
# We set it up in this order as what we setup first, will appear later in
# the path.
# See commit 7779044 for why this is required.
if test -d /usr/lib/rustup/bin
set -gxp PATH /usr/lib/rustup/bin
end
if test -d {$HOME}/.local/share/pnpm
set -gx PNPM_HOME {$HOME}/.local/share/pnpm
set -gxp PATH {$HOME}/.local/share/pnpm
end
for extra_path in ~/.{cabal,cargo,ghcup,go,local}/bin
if test -d "$extra_path"
set -gxp PATH "$extra_path"
end
end
if test -d /usr/lib/rustup/bin
set -gxp PATH /usr/lib/rustup/bin
end
if test -d {$HOME}/.nix-defexpr/channels
set -gx NIX_PATH {$HOME}/.nix-defexpr/channels
set -gx NIX_SSL_CERT_FILE '/etc/ssl/certs/ca-certificates.crt'
if test -d {$HOME}/.go
set -gx GOBIN {$HOME}/.go/bin
set -gx GOPATH {$HOME}/.go
end
if test -d /var/lib/flatpak
@ -27,11 +36,6 @@ function __fish_setup_on_tty_login --description "Set up environment on tty logi
end
end
if test -d {$HOME}/.local/share/pnpm
set -gx PNPM_HOME {$HOME}/.local/share/pnpm
set -gxp PATH {$HOME}/.local/share/pnpm
end
# Temporary directory for GStreamer dot files
mkdir -p /tmp/gst-dot
@ -42,11 +46,6 @@ function __fish_setup_on_tty_login --description "Set up environment on tty logi
# Needed for work
set -gx ENV qa-tunnel
if test -d {$HOME}/.go
set -gx GOBIN {$HOME}/.go/bin
set -gx GOPATH {$HOME}/.go
end
# Password Store
set -gx PASSWORD_STORE_ENABLE_EXTENSIONS true
set -gx PASSWORD_STORE_GENERATED_LENGTH 16