Skip to content

csessh/.dotfiles

Repository files navigation

Dotfiles

Personal development configuration files managed with GNU Stow and Nix + home-manager.

Supports Fedora and Ubuntu with desktop and server profiles.

Quick Start

One-liner (on a fresh system):

git clone https://github.com/csessh/.dotfiles.git ~/.dotfiles && ~/.dotfiles/bootstrap.sh

Or step by step:

# Clone the repo (uses HTTPS for fresh systems without SSH keys)
git clone https://github.com/csessh/.dotfiles.git ~/.dotfiles

# Run bootstrap script
~/.dotfiles/bootstrap.sh

The bootstrap script will:

  1. Prompt for host type (desktop/server)
  2. Install Nix (Fedora: native package, others: official installer)
  3. Enable flakes via stow
  4. Save host type to ~/.config/host-type
  5. Install home-manager and apply configuration
  6. Install system packages (Docker)
  7. Add user to docker group
  8. Install oh-my-zsh, remove stock .zshrc, stow shell config
  9. Install TPM (Tmux Plugin Manager)
  10. Stow configuration packages (desktop-only: ghostty, ssh)
  11. Set zsh as default shell

After bootstrap, log out and back in for all changes to take effect.

Host Type Profiles

Bootstrap prompts for host type:

Profile Packages Stow
Desktop Base + 1password, claude-code, fonts, xclip, pam_u2f, yubikey-manager All packages + ghostty, ssh, Yubico
Server Base only (CLI tools, dev tools, languages) Core packages only

To change host type after bootstrap:

echo "server" > ~/.config/host-type  # or "desktop"
home-manager switch --impure

Package Management

Adding a new package

Edit ~/.dotfiles/home-manager/.config/home-manager/packages.nix:

let
  basePackages = with pkgs; [
    # Packages for all hosts
    newpackage
  ];

  desktopPackages = with pkgs; [
    # Desktop-only packages
    gui-app
  ];
in { ... }

Then apply:

home-manager switch --impure

Updating packages

# Update flake inputs (gets latest nixpkgs)
nix flake update ~/.config/home-manager

# Apply updates
home-manager switch --impure

Garbage collection

# Remove old generations
nix-collect-garbage -d

Rollback

# List previous generations
home-manager generations

# Roll back to previous generation
home-manager switch --rollback

Configuration Management

Configurations are managed with GNU Stow. Each tool has its own directory that mirrors the target filesystem structure.

cd ~/.dotfiles

# Deploy a config
stow nvim

# Remove a config
stow -D nvim

# Restow (remove then deploy)
stow -R nvim

Stow Packages

Package Description Desktop Only
bat cat replacement with syntax highlighting
fastfetch system information tool
ghostty terminal emulator Yes
git git and lazygit configuration
nvim neovim configuration
shell zsh configuration (requires oh-my-zsh)
ssh SSH configuration Yes
tmux tmux configuration

What's Managed Where

Component Manager Notes
CLI tools (ripgrep, fd, fzf, bat, etc.) Nix Declarative, reproducible
Dev tools (neovim, tmux, git) Nix Same versions across machines
Languages (nodejs, python, go) Nix Consistent toolchain
Desktop apps (1password) Nix Desktop profile only
Ghostty System (dnf/apt) OpenGL compatibility
Docker System (dnf/apt/brew) System integration
oh-my-zsh curl installer Shell framework
Configs Stow Symlinked from dotfiles

YubiKey Authentication (Desktop)

Bootstrap configures YubiKey for SSH (PIV smart card) automatically. For PAM authentication (login/sudo with FIDO2), run the setup wizard:

~/.dotfiles/setup-yubikey-pam.sh

The wizard guides you through:

  1. FIDO2 PIN setup (skippable if already set)
  2. Key registration (primary + backup keys)
  3. PAM file configuration with backup and test-after-each
  4. Optional fingerprint reader disable

See Yubikey-auth.md for manual steps and recovery instructions.

About

dotfiles for various tools: git, nvim and whatnot

Topics

Resources

License

Stars

Watchers

Forks

Contributors