This is my dotfiles.
Do the platform-specific prerequisites first, then run the common bootstrap.
-
Enable systemd so the multi-user Nix daemon can run. Confirm
/etc/wsl.conf; if the[boot]section is missing, add it, then runwsl.exe --shutdownfrom Windows and reopen the distribution. Recent WSL on Ubuntu 26.04 enables it by default.# /etc/wsl.conf [boot] systemd=true
-
Install the apt packages.
gitandcurlare normally already present (gitclones the repo,curlfetches the Nix installer),zshis the login shell, andbubblewrapandsocatare sandbox prerequisites. The rest of the CLI tools come fromflake.nix.sudo apt update sudo apt install -y git curl zsh bubblewrap socat
-
Make zsh the default shell. apt registers it in
/etc/shells, sochshaccepts it directly. This only rewrites the login shell entry (it does not read.zshrc), so order relative to the bootstrap does not matter; it takes effect on the next login.chsh -s "$(command -v zsh)"
To be documented. macOS skips the systemd step and already ships zsh
as the default shell, so only the apt-specific items above differ.
Run these on any platform after the prerequisites above.
-
Clone the dotfiles. The setup tasks and symlinks assume the repository lives at
~/.dotfiles.git clone https://github.com/halkn/dotfiles.git "$HOME/.dotfiles" cd "$HOME/.dotfiles"
-
Install Nix (multi-user), then open a new shell so
nixis onPATH(the installer sources its profile from new login shells) andcdback into the repository.sh <(curl --proto '=https' --tlsv1.2 -L https://nixos.org/nix/install) --daemon -
Link
.configand install the Nix tools. Linking first puts.config/nix/nix.confin place, which enables thenix-commandandflakesfeatures needed bynix profile install.ln -snfT "$HOME/.dotfiles/.config" "$HOME/.config" nix profile install path:.#default
-
Run the setup task.
just setupre-links every dotfile (zsh, claude, etc.) and installs the Nix tools.just setup
When the bootstrap finishes, reopen the terminal (or start a new login shell) to enter zsh with the linked config.
zsh keeps its config under .config/zsh (XDG); the only file in $HOME is
a small .zshenv stub that sets ZDOTDIR and hands off to it. Put
machine-local settings in .config/zsh/.zshenv.local (environment) or
.config/zsh/.zshrc.local (interactive); both are gitignored.
The git config ($XDG_CONFIG_HOME/git/config) includes a relative
config.local sibling, which resolves under $XDG_CONFIG_HOME and is not
tracked here. Set your name and email there per machine:
git config -f "${XDG_CONFIG_HOME:-$HOME/.config}/git/config.local" user.name "Your Name"
git config -f "${XDG_CONFIG_HOME:-$HOME/.config}/git/config.local" user.email "you@example.com"Verify the effective identity (this reads the included config.local):
git config user.name && git config user.emailMost CLI tools and zsh plugins are managed by Nix via
flake.nix, and just setup / just update keep them in sync.
Useful tasks:
just # List tasks
just setup # Link dotfiles and install Nix tools
just update # Update Nix tools (flake.lock)
just fmt # Format Markdown, zsh files, and Neovim Lua files
just fmt-check # Check formatting without writing files
just lint # Run repository checks