This repository contains configuration files and scripts for configuring my desktop environment on macOS and Linux. The configurations are easily managed using GNU Stow, a symlink farm manager that simplifies the process of keeping dotfiles in order.
The repository is organized into the following packages:
- base/ - Core shell configurations (
.aliases,.zshrc,.zshenv,.gitconfig, etc.) - config-common/ - Cross-platform XDG configurations (
.config/nvim/,.config/tmux/,.config/pyenv/,.config/Code/, etc.) - config-linux/ - Linux-specific configurations (Hyprland, Waybar, Rofi, Tilix,
.gitconfig.local) - config-macos/ - macOS-specific configurations (iTerm2,
.gitconfig.local) - vscode-macos/ - macOS VS Code path (
Library/Application Support/Code/) - macos-services/ - macOS system services (
Library/LaunchAgents/) - ssh-linux/ - Linux-specific SSH configuration (
.ssh/) - ssh-macos/ - macOS-specific SSH configuration (
.ssh/) - local/ - Local user data (
.local/)
The repository uses GNU Stow to manage configuration files. Before installing the dotfiles, the following tools must be present:
gitstowzsh
Install them with:
Ubuntu/Debian:
apt install --yes git stow zshArch Linux:
pacman -S git stow zshmacOS (Homebrew):
brew install git stow zshClone the repository:
mkdir -p $HOME/Source
cd $HOME/Source
git clone --recurse-submodules --jobs $(nproc) https://github.com/RLovelett/dotfiles.git
cd dotfilesXDG Base Directory specification folders are used by applications to organize configuration, cache, data, and state files. The following command creates the standard directories with default values if the environment variables are not already set:
XDG_CONFIG_HOME=${XDG_CONFIG_HOME:-$HOME/.config}
XDG_CACHE_HOME=${XDG_CACHE_HOME:-$HOME/.cache}
XDG_DATA_HOME=${XDG_DATA_HOME:-$HOME/.local/share}
XDG_STATE_HOME=${XDG_STATE_HOME:-$HOME/.local/state}
mkdir -p $XDG_CONFIG_HOME $XDG_CACHE_HOME $XDG_DATA_HOME $XDG_STATE_HOME $HOME/.local/{,s}binThis repository uses GNU Stow with platform-specific packages for cross-platform compatibility.
For macOS:
stow --target $HOME --verbose base config-common config-macos local ssh-macos macos-services vscode-macosFor Linux:
stow --target $HOME --verbose base config-common config-linux ssh-linux localFor macOS:
stow --delete --target $HOME --verbose base config-common config-macos local ssh-macos macos-services vscode-macosFor Linux:
stow --delete --target $HOME --verbose base config-common config-linux ssh-linux localThe main .gitconfig includes platform-specific overrides via:
[include]
path = ~/.gitconfig.localThis section is primarily derived from Kirill Kuznetsov's article on securing
macOS with YubiKey, SSH, and
GnuPG.
The setup involves using launchctl to manage background services critical for
secure operations. Below are the commands used to setup and verify the
configuration:
launchctl load -F $HOME/Library/LaunchAgents/sh.brew.gnupg.gpg-agent.plist
launchctl load -F $HOME/Library/LaunchAgents/sh.brew.gnupg.link-ssh-auth-socket.plist$ launchctl list | grep sh.brew.gnupg
- 0 sh.brew.gnupg.gpg-agent
- 0 sh.brew.gnupg.link-ssh-auth-sock
$ pgrep -fl gpg-agent
50890 gpg-agent --homedir /Users/lovelettr/.gnupg --use-standard-socket --daemon
$ ssh-add -L
ssh-rsa AAAAB3NzaC...5UNE54ZNTQ== cardno:5413447For additional script management tips using launchd on macOS, visit Apple's
guide on script management with
launchd.
