Dotfiles for debian and arch Tested on debian and omarchy
Step 0: insert yubikey
step 1: git clone https://github.com/s15h/dotfiles.git
step 2: dotfiles/initial-startup/preperation.sh
- Add dotfiles for openvpn
- ~/.openvpn/template-vpn.sh
- private
- dotfiles
- home-server
- curriculum-vitae
- zettelkasten
- homelab
- dignitas
- own git config
- s15h
- open-gtd
~/.gitconfig (stowed from configs/.gitconfig) sets your global identity and switches to the Dignitas identity for anything under ~/project/dignitas/.
The Dignitas work email is intentionally not committed to this public repository. It lives in the untracked local file ~/.config/git/dignitas-identity.gitconfig, which the stowed ~/project/dignitas/.gitconfig includes:
mkdir -p ~/.config/git
cat > ~/.config/git/dignitas-identity.gitconfig <<'EOF'
[user]
email = you@dignitas.nl
EOFpreparation.sh creates this file for you — set DIGNITAS_GIT_EMAIL or answer the prompt. If it is missing, git safely falls back to your global identity.
To use yubikey as ssh the GPG agent is configured via two scripts:
~/.config/shell/gpg-agent.sh— sourced from~/.bashrcand~/.oh-my-zsh/custom/gpg.zshfor interactive shells.~/.config/shell/gpg-agent-profile.sh— sourced from~/.bash_profileand~/.profileso the graphical login session exportsSSH_AUTH_SOCKfor GUI apps.
initial-startup/preparation.sh can optionally bootstrap supported service logins with the Bitwarden CLI after the install finishes.
- Add the services you want to automate to
~/.config/dotfiles/login-bootstrap.conf - Run the preparation script and confirm the Bitwarden bootstrap prompt
- Log in to or unlock the Bitwarden CLI when asked
Supported automated services:
- GitHub CLI via
gh auth login - Docker registries via
docker login
The bootstrap config file supports these entry types:
gh|<hostname>|<bitwarden item with token in the password field>
docker|<registry>|<username>|<bitwarden item with password or token in the password field>
These services still require manual sign-in after installation:
- Bitwarden desktop
- Firefox / Firefox Sync
- Bruno
- Obsidian
- Zed
- Spotify
To enable use of gpg agent in ssh actions in jetbrains ui elements we need the SSH_AUTH_SOCK variable set.
The graphical login session already exports SSH_AUTH_SOCK (see Yubikey ssh), so IDEs launched from the desktop work too. The aliases below are a convenience/fallback for launching from a shell.
Aliases that launch JetBrains IDEs with the correct environment are available in:
- bash:
~/.config/shell/jetbrains.sh(sourced from~/.bashrc) - zsh:
~/.oh-my-zsh/custom/aliases.zsh
Available aliases: intellij-ssh, goland-ssh, phpstorm-ssh, pycharm-ssh, webstorm-ssh, datagrip-ssh
To make them work you need the toolbox to create shell scripts. Make sure the toolbox has writing permissions on the selected folder.
For Git commit signing with the YubiKey setup, point user.signingkey at the active signing subkey fingerprint with a trailing !, not at the primary certify key fingerprint.
initial-startup/preparation.sh now refreshes the smartcard state and writes ~/.config/git/signingkey.gitconfig with the newest usable signing subkey automatically on install.
If signing starts failing with Unusable secret key, refresh the smartcard state first:
gpg --card-status
# or
yubikey-switchestimated Time required: 15 minutes. subkey renewal only pushes expiration date forward. There is no need to adjust keys on remote hosts and the yubikeys can remain the same.
- Insert usb drive and check label with
sudo dmesg | tail - decrypt and mount usb drive
sudo cryptsetup luksOpen /dev/sda1 gnupg-secrets
# Check if the device label is correct (/dev/sdaX)
sudo mkdir -p /mnt/encrypted-storage
sudo mount /dev/mapper/gnupg-secrets /mnt/encrypted-storage- Create new temporary working directory and copy gpg keys to it
export GNUPGHOME=$(mktemp -d -t $(date +%Y.%m.%d)-XXXX)
cp -avi /mnt/encrypted-storage/gnupg_202112191956_CsF/* $GNUPGHOME/- Set the identity env variable and set the key variables
export IDENTITY="Sietze van den Bergh <sietze@s15h.nl>"
export KEYID=$(gpg -k --with-colons "$IDENTITY" | \
awk -F: '/^pub:/ { print $5; exit }')
export KEYFP=$(gpg -k --with-colons "$IDENTITY" | \
awk -F: '/^fpr:/ { print $10; exit }')
echo $KEYID $KEYFP- Set the certify pass. It's in bitwarden
export CERTIFY_PASS=ABCD-0123-IJKL-4567-QRST-UVWX- Set the new expiration date
export EXPIRATION=2027-02-01- Do the renewal
echo "$CERTIFY_PASS" | \
gpg --batch --pinentry-mode=loopback \
--passphrase-fd 0 --quick-set-expire "$KEYFP" "$EXPIRATION" \
$(gpg -K --with-colons | awk -F: '/^fpr:/ { print $10 }' | tail -n "+2" | tr "\n" " ")- Export the updated public key:
gpg --armor --export $KEYID | sudo tee ~/$KEYID-$(date +%F).ascCopy it from the home folder to this repo and commit it.
- Then on every machine where the key is used, import it
gpg --import ~/dotfiles/*.asc- (optional) Upload the key
gpg --send-key $KEYID- unmount and close usb drive
sudo umount /mnt/encrypted-storage
sudo cryptsetup luksClose gnupg-secrets