Personal configuration for macOS systems, managed using Nix flakes, nix-darwin, and home-manager.
Declarative and reproducible environment across machines:
- System-level configurations via
nix-darwin - User-specific configurations via
home-manager - Homebrew integration via
nix-homebrew - Cursor and Claude Code configurations from shared definitions
| Path | Contents |
|---|---|
flake.nix |
Inputs and darwinConfigurations for each host |
modules/ |
System-level configuration and the package set |
hosts/ |
Per-host configuration, keyed by hostname |
users/shared/ |
Program configuration shared across users |
users/<name>/ |
Per-user overrides |
-
Install Nix using the Determinate Systems installer:
curl --proto '=https' --tlsv1.2 -sSf -L \ https://install.determinate.systems/nix | sh -s -- install
Restart the shell after installation.
-
Clone the repository:
git clone https://github.com/khaykingleb/dotfiles.git ~/.config/dotfiles cd ~/.config/dotfiles
-
Bootstrap the configuration for your machine:
sudo nix run nix-darwin -- switch \ --flake .#<hostname> \ --show-tracewhere
<hostname>is one of the systems defined inflake.nix(e.g.macbook-pro-m4). -
Start a new shell, then reconcile the asdf-managed tools:
./users/shared/programs/asdf/install.sh
-
Install the repository hooks:
just pre-commit-init
The initial activation installs nh and the asdf runtime. Subsequent configuration changes use the Just recipes below.
just # list all available commands
just nix-apply <hostname> # build, diff, and apply a host
just nix-update-flake # update all flake inputs
just nix-update-flake nixpkgs # update selected flake inputs
just nix-clean # clean old generations, keeping recent rollbacks
just asdf-sync # reconcile asdf plugins and versions
just pre-commit-init # install pre-commit and commit-msg hooks
just pre-commit-update # update hook revisions
just pre-commit-run # run all hooksRemove the Determinate Nix installation explicitly:
/nix/nix-installer uninstall