Skip to content
gbastkowskiPublic

About

My dotfiles

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

1,943 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dotfiles

A Home Manager-based dotfiles setup for macOS and Arch Linux.

Structure

PathContents
flake.nixHome Manager flake (inputs and targets)
home/Home Manager modules (*.nix)
config/Nix configuration (nix.conf, enables flakes)
bin/Custom scripts deployed to ~~/.local/bin/~
emacs/Doom Emacs configuration (config.org)
claude/Global Claude Code configuration
kitty/Kitty terminal configuration
byobu/Byobu configuration
hypr/Hyprland configuration (Arch only)
sway/Sway configuration (Arch only)
walker/Walker launcher (Arch only)
wayvnc/Wayvnc configuration (Arch only)
systemd/Systemd user services (Arch only)
plover/Plover stenography configuration
opencode/OpenCode AI configuration
sbt/SBT build tool configuration
zsh/ZSH/p10k configuration
idea/IdeaVim configuration
clang/CMake toolchain files

Installation

Prerequisites

  • Git (to clone this repo)
  • Nix package manager

Bootstrap

Run the single bootstrap script — it detects the host automatically:

./bootstrap.sh

The script will walk through each step interactively:

  1. Install Nix (curl on macOS, yay on Arch)
  2. Enable the Nix daemon (Arch only)
  3. Link config/ to ~~/.config/nix~ (enables flakes)
  4. Build and switch to the Home Manager configuration
  5. Clone and install Doom Emacs into ~~/.emacs.doom/~

Collision handling

Home Manager refuses to overwrite unmanaged files. Use the -b backup flag on first switch to let it keep backups of existing files:

home-manager switch -b backup --flake .#ista-dotfiles

Validating without activating

home-manager build --flake .#ista-dotfiles

Day-to-day Usage

Run the upgrade script to pull the latest dotfiles, apply the Home Manager configuration, and update Doom Emacs:

~/.local/bin/system-upgrade.sh

Optional upgrade review

bin/system-upgrade.sh --review

For a nonstandard checkout location, set DOTFILES_DIR when using the installed script. Requires Python 3 and OpenCode 2.x. After the upgrade, this previews only failed steps’ stderr and unread, relevant Home Manager news (newest first, size-limited). Stdout and successful steps’ stderr are excluded. News is not marked as read.

Common credential patterns and secret-valued environment variables are redacted, but redaction is best-effort: inspect the preview before approving upload. Without explicit terminal confirmation, nothing is sent. Normal terminal output is unchanged; do not assume it is safe to share. Temporary captures are private and removed on normal exit.

The review uses an isolated, tool-denied OpenCode instance and never applies its recommendations. Review failure does not change the upgrade’s exit status. The model defaults to the global OpenCode model setting; override it with SYSTEM_UPGRADE_REVIEW_MODEL=provider/model. The approved report is stored in OpenCode’s session history as well as sent to the selected provider.

Offline tests (no package upgrades or model requests):

PYTHONDONTWRITEBYTECODE=1 python3 bin/tests/test-system-upgrade-review.py

Home Manager targets

TargetHostPlatform
ista-dotfilesdeess1mac*macOS (aarch64-darwin)
akiko-dotfilesakiko*Arch Linux (x86_64-linux)

Nix & Home Manager Primer

A brief glossary for the concepts used in this repo.

Nix

A purely functional package manager and build system. Packages are built in isolation and stored in the /nix/store (e.g. /nix/store/abc123-emacs-29.4/). Nothing is installed globally; everything is linked or referenced from there.

Flake

A self-contained Nix project with pinned inputs and declared outputs. nix/flake.nix is this repo’s flake — it declares all external dependencies (nixpkgs, home-manager, powerlevel10k, etc.) and the two Home Manager configurations as outputs. nix/flake.lock pins every input to an exact git revision, making builds reproducible.

Flake input

An external source (git repo, tarball) that the flake depends on. Inputs with flake = false are plain repos without their own flake.nix, consumed as raw file trees (e.g. chemacs2, powerlevel10k).

Home Manager

A tool that applies a Nix configuration to a user’s home directory. It manages dotfiles, shell config, and some programs declaratively — the home.file attribute set maps source files to $HOME paths as read-only symlinks into the Nix store.

home.file

Declares a symlink from a source file (in the repo or Nix store) into $HOME. Files managed this way are read-only; Home Manager owns them.

programs.*

Higher-level Home Manager modules (e.g. programs.zsh, programs.tmux, programs.git) that generate config files and wire up shell integration automatically.

Activation

Running home-manager switch compares the current generation with the new one and atomically applies the diff: it creates/removes symlinks, installs packages, and runs any activation scripts.

Common Home Manager Commands

CommandPurpose
home-manager switch --flake .#ista-dotfilesBuild the configuration and activate it (creates a new generation).
home-manager build --flake .#ista-dotfilesBuild only; produces a result symlink without touching $HOME.
home-manager switch -b backup --flake .#...First-time switch — back up unmanaged files that would collide.
home-manager generationsList previous generations with timestamps and store paths.
/nix/var/nix/profiles/per-user/$USER/home-manager-N-link/activateRoll back by activating an older generation directly.
home-manager news --flake .#ista-dotfilesShow news entries from modules (breaking changes, deprecations).
home-manager expire-generations '-30 days'Delete generations older than the cutoff.
nix flake updateRefresh all flake inputs (nixpkgs, home-manager, etc.) in flake.lock.
nix flake lock --update-input nixpkgsUpdate a single input only.
nix-collect-garbage -dGarbage-collect old store paths after expiring generations.

Replace ista-dotfiles with akiko-dotfiles on Arch Linux.

Password store

password-store.nix wires ~~/.password-store~ to a self-hosted bare git repo on each home-manager switch.

Prerequisites

  • gpg available on PATH (installed via home.packages).
  • At least one GPG secret key imported. Activation fails loudly if no secret key is present. Follow-up: gbastkowski/dotfiles#35 tracks adding GPG init to bootstrap.

Behavior

  • On a machine without ~~/.password-store~: clones the remote.
  • On a machine with the store but no origin: adds the configured remote.
  • On a machine with a mismatched origin: aborts the switch.
  • Otherwise: silent no-op.

Sync workflow

Sync is manual. After making changes on one machine:

pass git push

On another machine, before reading or editing secrets:

pass git pull

GitHub MCP server (Claude Code)

The GitHub MCP server (https://api.githubcopilot.com/mcp/) authenticates with a fine-grained personal access token, not OAuth — its auth server does not support dynamic client registration, so /mcp in-app auth fails.

The token is kept out of the config and out of git:

  • Stored in password-store under github.com/mcp-token.
  • zsh.nix exports it as GITHUB_MCP_PAT on shell start (pass show github.com/mcp-token).
  • ~~/.claude.json~ references it in the server’s Authorization header as Bearer ${GITHUB_MCP_PAT}; Claude Code expands the variable at launch.

Setup

  1. Create a fine-grained token at https://github.com/settings/tokens (Metadata read; Contents/Issues/Pull requests read or write as needed).
  2. Store it: pass insert -f github.com/mcp-token.
  3. Launch Claude Code from a fresh shell so GITHUB_MCP_PAT is in the environment.

Rotating

Replace the secret and restart Claude Code — no config change needed:

pass insert -f github.com/mcp-token

Notes

  • emacs/.doom.d/ is linked file-by-file so that ~~/.doom.d~ remains a writable directory (required by doom sync).
  • emacs/.emacs.doom/ (Doom Emacs itself) is cloned independently by bootstrap.sh, not managed by Home Manager.
  • ista-dotfiles is a private repo included as a Nix flake input (not a submodule).
  • config/nix.conf enables flakes and must be linked to ~~/.config/nix~ before running any nix commands. bootstrap.sh handles this.
  • After a gcc or libgccjit upgrade, re-run doom env to refresh the environment snapshot for GUI Emacs.

About

My dotfiles

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages