A batteries-included macOS setup powered by Nix: nix-darwin for system configuration + Home Manager for your shell/editor/dev tooling.
This repo is opinionated (terminal-first: Ghostty → tmux → Helix) but modular, so you can steal individual pieces or adopt the whole thing.
- One-command rebuilds:
just switchapplies the full machine config. - Declarative Homebrew: taps/casks/brews tracked in git (no “mystery laptop state”).
- Polished terminal workflow: tmux sessions persist (resurrect/continuum), fuzzy helpers, Catppuccin theme across tools.
- Shell QoL everywhere: Atuin history search on
Ctrl-r, zoxide, modern defaults (eza,rg,bat,trash,dust), macOS notifications for long commands. - Dev stack included: language tooling + infra tooling (Docker/K8s/Terraform, etc.) via modular Home Manager modules.
- Git feels great: delta (side-by-side + line numbers), SSH GitHub remotes, signed commits by default.
- Works on Apple Silicon + Intel:
aarch64-darwinandx86_64-darwin.
# See what this flake exposes (hosts, devShell, checks, etc.)
nix flake show
# Handy dev shell (nixpkgs-fmt/statix/deadnix/just)
nix develop -c just help
nix develop -c just showClone anywhere (examples use ~/dotfiles) and explore the available commands:
git clone https://github.com/lucass4/dotfiles ~/dotfiles
cd ~/dotfiles
nix develop -c just help- Ghostty auto-attaches to tmux session
main. - tmux is tuned for flow: prefix
C-a, huge scrollback, Catppuccin, fzf helpers, session restore. - macOS defaults are set intentionally: Caps Lock → Escape, fast key repeat, dark mode, Finder tweaks, predictable screenshot settings.
- Install Nix (required). This project assumes you can run
nixcommands.- Official installer docs: https://nixos.org/download
- Ensure your hostname exists in
flake.nix(this repo uses.#$(hostname -s); check withhostname -s). - Bootstrap nix-darwin:
nix run github:lnl7/nix-darwin -- switch --flake .#$(hostname -s)After that, day-to-day is:
nix develop -c just switchTo update Homebrew packages managed by this flake, use:
nix develop -c just update-brew- Build only (no activation):
nix develop -c just build - Apply (activates, uses sudo):
nix develop -c just switch - Diff current vs new:
nix develop -c just diff - Update flake + Homebrew + apply:
nix develop -c just update - Format/lint/check:
nix develop -c just ci(or runjust fmt,just lint,just checkinsidenix develop) - Dev shell:
nix develop(same asjust devoncejustis installed)
flake.nix # Hosts, nix-darwin + Home Manager wiring
justfile # Daily commands (build/switch/update/check)
hosts/ # Host-specific overrides (hosts/<hostname>.nix)
modules/
darwin/ # macOS system config (nix-darwin)
core/ # Nix daemon/env/users
system/ # defaults/ids
apps/ # app-specific config
homebrew.nix # taps/casks/brews
home/ # User config (Home Manager)
shell/ # zsh
editors/ # helix
terminals/ # ghostty/tmux
cli/ # common tools/git/yazi
dev/ # languages + infra tooling
- Want a great Zsh setup? Start at
modules/home/shell/zsh.nix(Atuin, starship, zoxide, modern aliases). - Want a comfy tmux? See
modules/home/terminals/tmux.nix(plugins + Catppuccin + persistence). - Want sane macOS defaults? See
modules/darwin/system/defaults.nix. - Want a tracked Homebrew manifest? See
modules/darwin/homebrew.nix.
This repo is tuned for my machine(s) and user lucas. To use it yourself, you typically want to:
- Add your machine under
darwinConfigurationsinflake.nix. - Create
hosts/<hostname>.nixfor any machine-specific overrides. - Replace user-specific values (search for
lucasis a good start):modules/darwin/system/defaults.nix(system.primaryUser)modules/darwin/core/users.nix(home directory)modules/home/cli/git.nix(git name/email/signing key)
- Add an entry under
hostsinflake.nix. - Optionally add
hosts/<hostname>.nixfor machine-specific overrides. - Run
nix develop -c just build/nix develop -c just switch.
darwin-rebuild ... --flake .#$(hostname -s) requires your hostname to exist in flake.nix under darwinConfigurations.
- Run
nix develop -c just cibefore pushing. - Don’t commit secrets (tokens, keys, private hostnames, etc.).
just switchuses sudo; Homebrew operations use network and may prompt for sudo.