darwin-modular-services
This repository adds support for NixOS-style modular services to nix-darwin, enabling declarative service management on macOS.
Demonstrates a clean, declarative approach to macOS configuration using Nix, with one-command setup and symlink-based config files that stay in sync.
Watch the walkthrough: https://youtu.be/5N-okeDdIuI
My personal Mac setup, managed with nix-darwin and home-manager. One repo, one command, and a fresh Mac ends up configured the same way every time.
These are my personal dotfiles, shared publicly so people can read them, learn from them, and fork them freely. Feature requests and pull requests are not accepted here, and PRs are auto-closed. If you find a bug, please open a GitHub Issue using the bug report template.
Running the switch builds:
configuration.nix, set nixpkgs.hostPlatform = "x86_64-darwin"; (the comment right there tells you the same thing).On a brand new Mac, from a bare clone of this repo:
git clone https://github.com/kunchenguid/dotfiles.git
cd dotfiles
Before you run it: review "Make it yours" below.
Change the host label or CPU architecture if needed, and read the Homebrew cleanup warning.
bootstrap.sh applies the config to your machine, so do this first.
./bootstrap.sh
bootstrap.sh does four things, in order:
~/.dotfiles.
This has to happen before the first build, because home.nix points at config files through ~/.dotfiles.user configured in flake.nix against your actual macOS username, and offers to fix it for you if they differ.darwin-rebuild switch.
It fetches the darwin-rebuild tool from the nix-darwin 26.05 release branch, then applies this repo's locked flake config.After that, darwin-rebuild exists and you're on the normal workflow below.
Once Nix is installed (bootstrap.sh step 1 handles that), you can check that the config builds without touching your system - handy when you have edited something: