Personal dotfiles for Linux, mostly for Nixpkgs/NixOS-based and Termux setups. Mirrored using GitLab's push mirroring feature. gitlab.com/andreijiroh-dev/dotfiles
linux dotfiles
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat(bashrc): add global bashrc stuff

Next, I'll import host-specifics then later this afternoon.

Signed-off-by: Andrei Jiroh Halili <ajhalili2006@gmail.com>

+144
+21
.bash_login
··· 1 + #!/usr/bin/env bash 2 + 3 + export HOST_SPECIFIC_BASHRC_PATH="$HOME/.config/$HOSTNAME.bashrc" 4 + 5 + # Stage 0: Source dotenv stuff from homedir 6 + source "$HOME/.env" 7 + if [[ -f "$HOME/.env.local" ]]; then 8 + source "$HOME/.env.local" 9 + export LOCAL_DOTENV_LOADED=true 10 + fi 11 + 12 + # Stage 1: Load global bashrc 13 + if [[ -f "$HOME/.bashrc" ]]; then 14 + source "$HOME/.bashrc" 15 + fi 16 + 17 + # Stage 2: Machine specifcs 18 + if [[ -f $HOST_SPECIFIC_BASHRC ]]; then 19 + source "$HOST_SPECIFIC_BASHRC_PATH" 20 + export HOST_SPECIFIC_BASHRC_LOADED=true 21 + fi
+53
.bashrc
··· 1 + #!/usr/bin/env bash 2 + 3 + # This is my meta bashrc file, with oh-my-posh instead of zsh-specific 4 + # oh-my-zsh, although I still use zsh as my default shell. Sorry for a 5 + # lot of personal commentary and links hellscape here, it's there for 6 + # in-code docs and for future me to not dig through 'git log' hell. 7 + # SPDX-License-Identifier: TBD 8 + 9 + ## Stage 0: Init keychain + GPG_TTY for pinentry hellscapes in TUI. ## 10 + ## This stage also initalizes oh-my-posh here. ## 11 + if [[ $TERMUX ]]; then 12 + export SSH_AGENT_=todo 13 + else 14 + eval $(keychain --agents gpg,ssh --eval) 15 + fi 16 + export GPG_TTY=$(tty) 17 + # Tip: I don't want to f**k things up on POSIX-based stuff, I might try 18 + # using 19 + if command -v oh-my-posh >>/dev/null; then 20 + eval "$(oh-my-posh init bash)" 21 + fi 22 + 23 + ## Stage 1: Init custom vars and shortcuts before anything else ## 24 + # Dotfiles stuff, maybe should be on ~/.env? 25 + export DOTFILES_HOME="$HOME/.dotfiles" 26 + export DOTFILES_BIN="$DOTFILES_HOME/bin" 27 + # gopath should be on ~/.local/share/go to not fuck up with local install 28 + # at ~/go if exists 29 + export GOPATH="$HOME/.local/share/go" 30 + # Shut up, VS Code (not the OSS distributions off github:microsoft/vscode). 31 + # Don't let me pay for JetBrains IDEs or go nuts with nvim (or emacs, since 32 + # I'm both a bit neutral and off the rails at Vim vs Emacs debate). Also RIP 33 + # to my first editor after Notepad that started my web dev + Linux journey, 34 + # Atom (https://github.com/atom). 35 + export EDITOR=nano 36 + # For compartibility reasons and not to fuck things up on ~/go/bin. 37 + # Custom path might be also on ~/.env too? 38 + export PATH="$DOTFILES_BIN:$HOME/go/bin:$HOME/.local/bin:$GOPATH/bin:$PATH" 39 + # It would be nice if I would work on self-hosted reimplementation of 40 + # proxy.golang.org, but in meanwhile, you need to fuck off Google on this. 41 + # (Fucking Facebook and Microsoft off your lives are also hard too ICYMI.) 42 + # Context: https://git.sr.ht/~sircmpwn/dotfiles/tree/master/item/.profile#L13-15 43 + # and https://drewdevault.com/2021/08/06/goproxy-breaks-go.html 44 + export GOPROXY=direct GOSUMDB=off 45 + 46 + ## Stage 2: Source literally everything else ## 47 + if [[ -d "$HOME/.bashbox" ]]; then 48 + source "$HOME/.bashbox/env" 49 + fi 50 + 51 + export HOMEBREW_HOME=${HOMEBREW_HOME:-"/home/linuxbrew/.linuxbrew"} 52 + test -d "$HOMEBREW_HOME" && eval "$($HOMEBREW_HOME/bin/brew shellenv)" 53 + [[ -r "$HOMEBREW_HOME/etc/profile.d/bash_completion.sh" ]] && . "$HOMEBREW_HOME/etc/profile.d/bash_completion.sh"
+42
.env
··· 1 + #!/usr/bin/env sh 2 + 3 + # SPDX-License-Identifier: MIT AND MPL-2.0 4 + # 5 + # This is POSIX sh-compartible shell script to sourced for both shortcuts 6 + # to daily commands I use and then some. 7 + # 8 + # PLEASE DO NOT LEAK ANY SECRETS, INCLUDING DOPPLER CLI TOKENS AND TAILSCALE_AUTHKEYS 9 + # IN THIS BLOODY FILE! 10 + # 11 + # https://packaging.ubuntu.com/html/getting-set-up.html#configure-your-shell 12 + export DEBFULLNAME="Andrei Jiroh Halili" 13 + # Temporary Gmail address for devel stuff, even through my longer email one is, well, 14 + # on my public GPG key btw, so YOLO it. 15 + export DEBEMAIL="ajhalili2006@gmail.com" 16 + 17 + ########################################################################################## 18 + # Code snippets from https://git.sr.ht/~sircmpwn/dotfiles/tree/db5945a4/item/.env 19 + ########################################################################################## 20 + if ls --version 2>&1 | grep -i gnu >/dev/null 21 + then 22 + alias ls='ls --color=auto ' 23 + elif ls --version 2>&1 | grep -i busybox >/dev/null 24 + then 25 + alias ls='ls --color=auto ' 26 + fi 27 + 28 + alias recent='ls -ltch' 29 + 30 + # Add optmizations for multicore builds 31 + if [ $(uname) = "Linux" ] 32 + then 33 + nproc=$(grep '^processor' /proc/cpuinfo | wc -l) 34 + if [ $nproc -gt 4 ] 35 + then 36 + # Reserve two cores 37 + nproc=$((nproc - 2)) 38 + fi 39 + export MAKEFLAGS="-j$nproc" 40 + export SAMUFLAGS="-j$nproc" 41 + fi 42 + ##########################################################################################
+9
.profile
··· 1 + # if running bash 2 + if [ -n "$BASH_VERSION" ]; then 3 + # include .bashrc if it exists 4 + if [ -f "$HOME/.bashrc" ]; then 5 + . "$HOME/.bashrc" 6 + fi 7 + fi 8 + 9 + source "$HOME/.env"
+7
.trunk/.gitignore
··· 1 + *out 2 + *logs 3 + *actions 4 + *notifications 5 + plugins 6 + user_trunk.yaml 7 + user.yaml
+12
.trunk/trunk.yaml
··· 1 + version: 0.1 2 + cli: 3 + version: 1.3.1 4 + plugins: 5 + sources: 6 + - id: trunk 7 + ref: v0.0.8 8 + uri: https://github.com/trunk-io/plugins 9 + lint: 10 + enabled: 11 + - shfmt@3.5.0 12 + - shellcheck@0.7.2