2023-01-05 17:22:50 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
# This is my meta bashrc file, with oh-my-posh instead of zsh-specific
|
|
|
|
# oh-my-zsh, although I still use zsh as my default shell. Sorry for a
|
|
|
|
# lot of personal commentary and links hellscape here, it's there for
|
|
|
|
# in-code docs and for future me to not dig through 'git log' hell.
|
2023-09-03 14:51:35 +00:00
|
|
|
# SPDX-License-Identifier: MIT AND MPL-2.0
|
2023-01-05 17:22:50 +00:00
|
|
|
|
|
|
|
## Stage 0: Init keychain + GPG_TTY for pinentry hellscapes in TUI. ##
|
2023-09-03 14:51:35 +00:00
|
|
|
## This stage also initalizes oh-my-posh or custom
|
|
|
|
## PSI here. ##
|
2023-01-05 17:22:50 +00:00
|
|
|
if [[ $TERMUX ]]; then
|
|
|
|
export SSH_AGENT_=todo
|
2023-05-12 16:55:54 +00:00
|
|
|
elif command -v keychain >> /dev/null; then
|
2024-04-13 11:25:23 +00:00
|
|
|
# shellcheck disable=SC2155
|
|
|
|
export KEYCHAIN_PATH=$(command -v keychain)
|
2023-01-05 17:22:50 +00:00
|
|
|
eval $(keychain --agents gpg,ssh --eval)
|
|
|
|
fi
|
2024-04-13 11:25:23 +00:00
|
|
|
# shellcheck disable=SC2155
|
2023-01-05 17:22:50 +00:00
|
|
|
export GPG_TTY=$(tty)
|
2023-09-03 14:51:35 +00:00
|
|
|
|
2023-10-08 01:26:02 +00:00
|
|
|
# how about detecting local configs
|
|
|
|
if [ -f "$HOME/.config/localconfig.env" ]; then
|
|
|
|
. "$HOME/.config/localconfig.env"
|
|
|
|
fi
|
|
|
|
|
2023-09-03 14:51:35 +00:00
|
|
|
## Stage 1: Init custom vars and shortcuts before anything else ##
|
|
|
|
## Note that ~/.env and ~/.env.local should be loaded eariler on ##
|
2023-01-05 17:22:50 +00:00
|
|
|
# Dotfiles stuff, maybe should be on ~/.env?
|
2023-09-03 14:51:35 +00:00
|
|
|
#export DOTFILES_HOME="$HOME/.dotfiles"
|
2024-01-16 07:45:57 +00:00
|
|
|
export DOTFILES_BIN="$HOME/bin"
|
2023-01-05 17:22:50 +00:00
|
|
|
# gopath should be on ~/.local/share/go to not fuck up with local install
|
|
|
|
# at ~/go if exists
|
|
|
|
export GOPATH="$HOME/.local/share/go"
|
2024-08-17 06:34:58 +00:00
|
|
|
export PATH="${GOPATH}/bin:${PATH}"
|
2023-01-05 17:22:50 +00:00
|
|
|
# Shut up, VS Code (not the OSS distributions off github:microsoft/vscode).
|
|
|
|
# Don't let me pay for JetBrains IDEs or go nuts with nvim (or emacs, since
|
|
|
|
# I'm both a bit neutral and off the rails at Vim vs Emacs debate). Also RIP
|
|
|
|
# to my first editor after Notepad that started my web dev + Linux journey,
|
|
|
|
# Atom (https://github.com/atom).
|
|
|
|
export EDITOR=nano
|
|
|
|
# Context: https://git.sr.ht/~sircmpwn/dotfiles/tree/master/item/.profile#L13-15
|
|
|
|
# and https://drewdevault.com/2021/08/06/goproxy-breaks-go.html
|
|
|
|
export GOPROXY=direct GOSUMDB=off
|
2023-08-22 17:01:58 +00:00
|
|
|
# nix profile install nixpkgs#glibcLocale
|
|
|
|
export LOCALE_ARCHIVE="$HOME/.nix-profile/lib/locale/locale-archive"
|
2024-01-16 07:45:57 +00:00
|
|
|
export PATH="${DOTFILES_BIN}:${GOPATH}/bin:${HOME}/.local/bin:${PATH}"
|
2023-01-05 17:22:50 +00:00
|
|
|
|
|
|
|
## Stage 2: Source literally everything else ##
|
|
|
|
if [[ -d "$HOME/.bashbox" ]]; then
|
2024-04-13 11:25:23 +00:00
|
|
|
# shellcheck disable=SC1091
|
2023-01-05 17:22:50 +00:00
|
|
|
source "$HOME/.bashbox/env"
|
|
|
|
fi
|
|
|
|
|
2024-08-17 06:34:58 +00:00
|
|
|
source "$HOME/.config/bash/bashrc"
|