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
···55# portable at least.
66# SPDX-License-Identifier: MPL-2.0
7788+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+865### from Debian and Ubuntu - START ###
966# don't put duplicate lines or lines starting with space in the history.
1067# See bash(1) for more options
···54111 ;;
55112esac
561135757-# enable color support of ls and also add handy aliases
5858-if [ -x /usr/bin/dircolors ]; then
5959- test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
6060- alias ls='ls --color=auto'
6161- #alias dir='dir --color=auto'
6262- #alias vdir='vdir --color=auto'
6363-6464- alias grep='grep --color=auto'
6565- alias fgrep='fgrep --color=auto'
6666- alias egrep='egrep --color=auto'
6767-fi
6868-69114# colored GCC warnings and errors
70115export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
7171-7272-alias ll='ls -alF'
7373-alias la='ls -A'
7474-alias l='ls -CF'
7511676117# enable programmable completion features (you don't need to enable
77118# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
···109150 unset OP_SSH_AUTH_SOCK
110151}
111152112112-try_keychain_ssh_agent() {
113113- if [[ $FF_KEYCHAIN == "1" ]]; then
114114- echo "[ssh-agent-loader::keychain] attempting to use keychain for SSH agents"
115115- eval "$(keychain --eval --agents ssh,gpg)"
116116- fi
117117-}
118118-119119-ssh-agent-loader() {
120120- if [[ $1 == "" || $1 == "auto" ]]; then
121121- unset SSH_AGENT_PID SSH_AUTH_SOCK
122122- if try_1password_ssh_agent; then
123123- return
124124- elif try_keychain_ssh_agent; then
125125- return
126126- else
127127- echo "[ssh-agent-loader] SSH agent seems to be failed to load at the moment"
128128- echo "[ssh-agent-loader] try again later by manually invoking the shell function"
129129- return 1
130130- fi
131131- elif [[ $1 == "1passowrd" || $1 == "op" ]]; then
132132- unset SSH_AGENT_PID SSH_AUTH_SOCK
133133- try_1password_ssh_agent
134134- elif [[ $1 == "keychain" ]]; then
135135- try_keychain_ssh_agent
136136- else
137137- echo "ssh-agent-loader [auto|[1password|op|1p]|keychain]"
138138- return 1
139139- fi
140140-}
141141-142142-command -v direnv >> /dev/null && eval "$(direnv hook bash)"
143143-144153# Technically a hack in case we don't use home-manager switch
145154if [ -L "$HOME/.nix-profile" ] && [ -e "$HOME/.nix-profile" ]; then
146155 export PATH="$HOME/.nix-profile/bin:$HOME:$PATH"
147147- if [ -f "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh" ]; then
148148- source "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh"
149149- # Don't return yet, since we still do some stuff after that.
150150- #return
151151- fi
156156+ hm-vars-loader
152157fi
153158154159export PATH="$HOME/bin:$HOME/.local/bin:$PATH"
···168173 ssh-agent-loader auto
169174fi
170175export EDITOR GIT_EDITOR=$EDITOR
176176+177177+command -v direnv >> /dev/null && eval "$(direnv hook bash)"
+35
.config/bash/aliases
···11+#!/usr/bin/env bash
22+33+# enable color support of ls and also add handy aliases
44+if [ -x /usr/bin/dircolors ]; then
55+ test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
66+ alias ls='ls --color=auto'
77+ #alias dir='dir --color=auto'
88+ #alias vdir='vdir --color=auto'
99+1010+ alias grep='grep --color=auto'
1111+ alias fgrep='fgrep --color=auto'
1212+ alias egrep='egrep --color=auto'
1313+fi
1414+1515+alias ll='ls -alF'
1616+alias la='ls -A'
1717+alias l='ls -CF'
1818+1919+alias ..='cd ..'
2020+alias ...='cd ../..'
2121+2222+# git
2323+alias clone='git clone'
2424+alias status='git status'
2525+alias stats='git status'
2626+alias stash='git stash'
2727+alias commit='git commit'
2828+alias signoff='git commit --signoff'
2929+alias push='git push'
3030+alias fetch='git fetch'
3131+alias pull='git pull --rebase'
3232+alias remotes='git remote -v'
3333+alias switch-upstream='git branch -u'
3434+alias module="git submodule"
3535+alias update-module="git submodule update --remote --merge"
+7-5
README.md
···11# `@andreijiroh-dev/dotfiles@nixos` - @ajhalili2006's dotfiles under nixos + nixpkgs!
2233Yup, I'm starting a fresh for my dotfiles for 2025 and beyond, now with
44-[nixpkgs](https://nixos.org) and [home-manager](https://nix-community.github.io/home-manager).
55-(Don't worry, I'll be maintaining the yadm-era setup for non-Nix setups seperately
66-as seperate branches for prosperity.)
44+[nixpkgs](https://nixos.org) and [home-manager](https://nix-community.github.io/home-manager)
55+in mind. Backwards-compatible with non-nixpkgs setups via `yadm`.
7687## Usage
98···1615git init
1716git remote add origin https://mau.dev/andreijiroh-dev/dotfiles
1817git checkout -f main
1818+ln -s ./.git ./.local/share/yadm/repo.git # so that we can use yadm later
1919```
20202121-If you prefer to cook up with yadm:
2121+If you prefer to cook up with `yadm` first:
22222323```bash
2424yadm clone https://github.com/andreijiroh-dev/dotfiles
2525-ln -s ./.local/share/yadm/TBD ./.git # so that we can normally use git here
2525+ln -s ./.local/share/yadm/repo.git ./.git # so that we can normally use git here
2626```
27272828### Using nix flakes + home-manager
···5151Note that this should work on most desktop apps, although if you're in Nest (and friends
5252with RDP access), connect to there first and authenicate. You may need to adjust security
5353settings in the desktop app to ensure nothing go wrong.
5454+5555+Alternatively, you can export the private keys with password encryption
54565557## Directory + File Map
5658