This is a Windows dotfiles repository that uses a bare Git repository pattern to track configuration files directly in the user profile directory ($env:userprofile). The repository is designed to manage dotfiles on Windows while respecting both Windows conventions (AppData) and Unix conventions (XDG Base Directory).
Critical Understanding: This repository does NOT use traditional symlinks. Instead, it leverages Git's --git-dir and --work-tree flags to manage files in place.
# The sw alias is defined in Documents/Powershell/Profile.ps1
sw <git-command> # Equivalent to: git --git-dir=$env:userprofile/sync-windows/ --work-tree=$env:userprofile <git-command>Work tree: $env:userprofile (the user's home directory)
Git directory: $env:userprofile/sync-windows/ (this repository's .git location)
This means:
- Files are tracked in their original locations (no symlinks needed)
- Use
swinstead ofgitfor all operations when managing dotfiles - The
.gitignoreexcludes most Windows user directories (Desktop, Downloads, etc.) to only track config files
# Check status of tracked dotfiles
sw status
# Add a configuration file
sw add .config/starship.toml
# Commit changes
sw commit -m "update: starship prompt configuration"
# Push to remote
sw push
# View diff
sw diff# Update all Scoop packages (cleans cache too)
scoop-ultimate
# Update all Winget packages
winget-ultimate
# Update everything (Scoop + Winget) and create backup
windows-ultimate
# Backup current package lists to backup/ directory
windows-backup# Enter nix development shell (auto-loads via direnv)
nix develop
# Format Nix code
nix fmt
# Launch MSYS2 with fish shell
msys# Format Nix files using treefmt (alejandra, deadnix, statix)
nix fmt.config/ - XDG-compliant configs (Unix convention on Windows)
git/- Git global config and ignore patternsstarship.toml- Shell prompt configurationwezterm/- Terminal emulator (Lua config)tridactyl/- Firefox vim bindingsfastfetch/- System info displaywhkdrc- Window hotkey daemon for window management
Documents/Powershell/ - PowerShell configuration
Profile.ps1- Shell initialization, aliases, and the criticalswfunctionpowershell.config.json- Execution policy config
AppData/ - Windows application data (mirrors Windows structure)
Roaming/Mozilla/Firefox/- Firefox profile with extensive privacy hardeningRoaming/kanata/- Keyboard remapping (legacy)
backup/ - Package manager snapshots
scoop_backup.txt- Installed Scoop packageswinget_backup.txt- Installed Winget packagesmsys_pacman.txt- MSYS2 packages
flake.nix- Nix development environment definitionflake.lock- Locked dependency versions.envrc- Direnv integration for auto-loading Nix shell.editorconfig- Editor settings (UTF-8, LF line endings, 2-space indent)
Uses conventional commits pattern observed in recent history:
chore(component):- Maintenance tasksfix(component):- Bug fixesfeat(component):- New featuresrefactor(component):- Code restructuring
Common components: nix, ignore, pwsh, scoop, whkd
When adding new dotfiles:
-
Place config files in appropriate locations:
- Cross-platform tools →
.config/ - PowerShell scripts →
Documents/Powershell/ - Windows apps →
AppData/Roaming/orAppData/Local/
- Cross-platform tools →
-
Track with
sw add <path>(NOTgit add) -
Update
.gitignoreif excluding new user data directories -
If adding new tools, update package backups:
windows-backup
The Documents/Powershell/Profile.ps1 file is critical infrastructure:
- Defines the
swalias (DO NOT BREAK THIS) - Sets environment variables (PATH, EDITOR, VISUAL, SHELL)
- Provides package management shortcuts
- Runs fastfetch and starship on shell startup
When modifying, preserve the Invoke-GitWithCustomPaths function integrity.
Package Managers:
- Scoop - Primary package manager (port-based, scoop-ultimate updates all)
- Winget - Windows Package Manager (winget-ultimate updates all)
- MSYS2 - Unix-like environment with Pacman (launch with
msys)
Key Applications:
- Terminal: Wezterm (Lua config in
.config/wezterm/) - Editor: Neovim (via
vim.exefrom Scoop) - Shell: PowerShell 7.x with Starship prompt
- Browser: Firefox with privacy hardening and Tridactyl vim bindings
- Version Control: Git 2.52+
This repository includes Nix flake configuration for reproducible development:
Flake modules:
treefmt-nix- Code formatting (alejandra, deadnix, statix for Nix)devshell- Development shell with PowerShell
Usage:
# Enter dev shell (or let direnv auto-load via .envrc)
nix develop
# Format code
nix fmtThe .envrc file enables automatic environment loading when entering the directory.
- Always use
swfor git operations - Usinggitdirectly will operate on the sync-windows repository itself, not the dotfiles - Preserve the bare repo pattern - Do not convert to a normal git repo or use symlinks
- Respect the .gitignore - Personal files (Desktop, Downloads, Documents, etc.) should remain untracked
- Line endings are LF -
.editorconfigenforces Unix line endings even on Windows - 2-space indentation - Standard across all files per
.editorconfig