Select the types of activity you want to include in your feed.
Personal dotfiles for Linux, mostly for Nixpkgs/NixOS-based and Termux setups. Mirrored using GitLab's push mirroring feature.
gitlab.com/andreijiroh-dev/dotfiles
···11-#!/usr/bin/env bash
22-#shellcheck disable=SC1091
33-44-# My base bash shell customizations outside Home Manager, to make things
55-# portable at least.
66-# SPDX-License-Identifier: MPL-2.0
77-88-try_keychain_ssh_agent() {
99- if [[ $FF_KEYCHAIN == "1" ]]; then
1010- echo "[ssh-agent-loader::keychain] attempting to use keychain for SSH agents"
1111- eval "$(keychain --eval --agents ssh,gpg)"
1212- fi
1313-}
1414-1515-ssh-agent-loader() {
1616- if [[ $1 == "" || $1 == "auto" ]]; then
1717- if [[ $SSH_CONNECTION != "" ]] && [[ $VSCODE_IPC_HOOK_CLI != "" ]]; then
1818- echo "[ssh-agent-loader] automatic detection disabled while you're in a VS Code Remote SSH session"
1919- return
2020- fi
2121-2222- export OLD_SSH_AUTH_SOCK="$SSH_AUTH_SOCK"
2323-2424- unset SSH_AGENT_PID SSH_AUTH_SOCK
2525- if try_1password_ssh_agent; then
2626- return
2727- elif try_keychain_ssh_agent; then
2828- return
2929- else
3030- echo "[ssh-agent-loader] SSH agent seems to be failed to load at the moment"
3131- echo "[ssh-agent-loader] try again later by manually invoking the shell function"
3232- return 1
3333- fi
3434- elif [[ $1 == "1passowrd" || $1 == "op" ]]; then
3535- unset SSH_AGENT_PID SSH_AUTH_SOCK
3636- try_1password_ssh_agent
3737- elif [[ $1 == "keychain" ]]; then
3838- try_keychain_ssh_agent
3939- else
4040- echo "ssh-agent-loader [auto|[1password|op|1p]|keychain]"
4141- return 1
4242- fi
4343-}
4444-4545-# handle
4646-hm-vars-loader() {
4747- if [ -f "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh" ]; then
4848- source "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh"
4949- HM_SESSION_VARS_PATH="$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh"
5050- HM_SESSION_VARS_LOADED=true
5151- elif [ -f "$HOME/.local/state/nix/profiles/profile/etc/profile.d/hm-session-vars.sh" ]; then
5252- source "$HOME/.local/state/nix/profiles/profile/etc/profile.d/hm-session-vars.sh"
5353- HM_SESSION_VARS_PATH="$HOME/.local/state/nix/profiles/profile/etc/profile.d/hm-session-vars.sh"
5454- HM_SESSION_VARS_LOADED=true
5555- elif [ -f "/etc/profiles/per-user/$USER/etc/profile.d/hm-session-vars.sh" ]; then
5656- source "/etc/profiles/per-user/$USER/etc/profile.d/hm-session-vars.sh"
5757- HM_SESSION_VARS_PATH="/etc/profiles/per-user/$USER/etc/profile.d/hm-session-vars.sh"
5858- HM_SESSION_VARS_LOADED=true
5959- else
6060- HM
6161- fi
6262- export HM_SESSION_VARS_LOADED HM_SESSION_VARS_PATH
6363-}
6464-6565-### from Debian and Ubuntu - START ###
6666-# don't put duplicate lines or lines starting with space in the history.
6767-# See bash(1) for more options
6868-HISTCONTROL=ignoreboth
6969-7070-# append to the history file, don't overwrite it
7171-shopt -s histappend
7272-7373-# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
7474-HISTSIZE=2500
7575-HISTFILESIZE=5000
7676-7777-# set a fancy prompt (non-color, unless we know we "want" color)
7878-case "$TERM" in
7979- xterm-color|*-256color) color_prompt=yes;;
8080-esac
8181-8282-# uncomment for a colored prompt, if the terminal has the capability; turned
8383-# off by default to not distract the user: the focus in a terminal window
8484-# should be on the output of commands, not on the prompt
8585-#force_color_prompt=yes
8686-8787-if [ -n "$force_color_prompt" ]; then
8888- if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
8989- # We have color support; assume it's compliant with Ecma-48
9090- # (ISO/IEC-6429). (Lack of such support is extremely rare, and such
9191- # a case would tend to support setf rather than setaf.)
9292- color_prompt=yes
9393- else
9494- color_prompt=
9595- fi
9696-fi
9797-9898-if [ "$color_prompt" = yes ]; then
9999- PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
100100-else
101101- PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
102102-fi
103103-unset color_prompt force_color_prompt
104104-105105-# If this is an xterm set the title to user@host:dir
106106-case "$TERM" in
107107-xterm*|rxvt*)
108108- PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
109109- ;;
110110-*)
111111- ;;
112112-esac
113113-114114-# colored GCC warnings and errors
115115-export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
116116-117117-# enable programmable completion features (you don't need to enable
118118-# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
119119-# sources /etc/bash.bashrc).
120120-if ! shopt -oq posix; then
121121- if [ -f /usr/share/bash-completion/bash_completion ]; then
122122- . /usr/share/bash-completion/bash_completion
123123- elif [ -f /etc/bash_completion ]; then
124124- . /etc/bash_completion
125125- fi
126126-fi
127127-### from Debian and Ubuntu - END ###
128128-129129-# do feature detection if keychain is installed
130130-if command -v keychain >> /dev/null; then
131131- FF_KEYCHAIN=1
132132-else
133133- FF_KEYCHAIN=0
134134-fi
135135-136136-try_1password_ssh_agent() {
137137- export OP_SSH_AUTH_SOCK="$HOME/.1password/agent.sock"
138138- if [[ ! -S "$OP_SSH_AUTH_SOCK" ]]; then
139139- echo "[ssh-agent-loader::1password] 1Password SSH agent isn't enabled or desktop app isn't installed yet"
140140- return 1
141141- fi
142142-143143- echo "[ssh-agent-loader::1password] attempting to use 1Password SSH agent"
144144- if ! SSH_AUTH_SOCK=$OP_SSH_AUTH_SOCK ssh-add -l >> /dev/null 2>&1; then
145145- echo "[ssh-agent-loader::1password] something went wrong while checking for 1Password SSH agent availability"
146146- echo "[ssh-agent-loader::1password] unlock the desktop app first or enable SSH agent from settings"
147147- return 1
148148- fi
149149- export SSH_AUTH_SOCK=$OP_SSH_AUTH_SOCK
150150- unset OP_SSH_AUTH_SOCK
151151-}
152152-153153-# Technically a hack in case we don't use home-manager switch
154154-if [ -L "$HOME/.nix-profile" ] && [ -e "$HOME/.nix-profile" ]; then
155155- export PATH="$HOME/.nix-profile/bin:$HOME:$PATH"
156156- hm-vars-loader
157157-fi
158158-159159-export PATH="$HOME/bin:$HOME/.local/bin:$PATH"
160160-export DOCKER_BUILDKIT=1
161161-162162-# Check if we're running bash shell inside VS Code and update EDITOR and
163163-# GIT_EDITOR accordingly. We'll probably figure it out for desktop, but in the
164164-# meanwhile, just stick to nano at the moment.
165165-if [[ -n $VSCODE_IPC_HOOK_CLI ]]; then
166166- EDITOR="code --wait"
167167- ssh-agent-loader auto
168168-elif [[ -n "$SSH_CONNECTION" ]]; then
169169- EDITOR="nano"
170170- ssh-agent-loader keychain
171171-else
172172- EDITOR="nano"
173173- ssh-agent-loader auto
174174-fi
175175-export EDITOR GIT_EDITOR=$EDITOR
176176-177177-command -v direnv >> /dev/null && eval "$(direnv hook bash)"
178178-source /home/gildedguy/.config/op/plugins.sh
-29
.profile
···11-#!/usr/bin/env sh
22-33-# ~/.profile: executed by the command interpreter for login shells.
44-# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
55-# exists.
66-# see /usr/share/doc/bash/examples/startup-files for examples.
77-# the files are located in the bash-doc package.
88-99-# the default umask is set in /etc/profile; for setting the umask
1010-# for ssh logins, install and configure the libpam-umask package.
1111-#umask 022
1212-1313-# if running bash
1414-if [ -n "$BASH_VERSION" ]; then
1515- # include .bashrc if it exists
1616- if [ -f "$HOME/.bashrc" ]; then
1717- . "$HOME/.bashrc"
1818- fi
1919-fi
2020-2121-# set PATH so it includes user's private bin if it exists
2222-if [ -d "$HOME/bin" ] ; then
2323- PATH="$HOME/bin:$PATH"
2424-fi
2525-2626-# set PATH so it includes user's private bin if it exists
2727-if [ -d "$HOME/.local/bin" ] ; then
2828- PATH="$HOME/.local/bin:$PATH"
2929-fi