This repository contains a macOS system configuration built with Nix, nix-darwin, Home Manager, flake-parts, and the Den framework.
It is structured so the machine-specific values live in settings.nix, while the rest of the configuration is split into reusable Den aspects.
- nix-darwin system configuration for macOS.
- Home Manager configuration for the primary user.
- Den host and user aspects for composing system and user modules.
- Homebrew package, tap, and cask management through nix-darwin.
- Shell, terminal, window manager, status bar, Git, and CLI tool configuration.
- Out-of-store symlinks for local assets under
assets/. - A generated
flake.nixmanaged byflake-filefrommodules/inputs.nix.
Edit settings.nix before building on a different Mac or for a different user:
rec {
username = "your-user";
hostname = "your-hostname";
hostPlatform = "aarch64-darwin";
homeDirectory = "/Users/${username}";
repoDirectory = "${homeDirectory}/nix";
gitUserName = username;
gitUserEmail = "you@example.com";
}Use x86_64-darwin for Intel Macs. Keep repoDirectory aligned with the clone path because several Home Manager files symlink scripts from assets/.
flake.nix: generated flake entrypoint. Do not edit directly.flake.lock: pinned input revisions.settings.nix: host, user, home directory, repo path, platform, and Git identity settings.modules/inputs.nix: source of truth for flake inputs and description.modules/dendritic.nix: enables flake-file and Den dendritic modules.modules/hosts.nix: declares the Den host and attached user fromsettings.nix.modules/aspects.nix: composes host-level and user-level Den aspects.modules/outputs.nix: exposes the default package as the configured nix-darwin system.modules/programs/: individual system and Home Manager aspects.assets/: local scripts, SketchyBar files, Kitty helpers, and fonts referenced by modules.Justfile: helper commands for regenerating and switching the system.
Install Nix in daemon mode:
sh <(curl --proto '=https' --tlsv1.2 -L https://nixos.org/nix/install) --daemonEnable flakes for the first build if your Nix install does not already have them enabled:
mkdir -p ~/.config/nix
printf 'experimental-features = nix-command flakes\n' >> ~/.config/nix/nix.confRestart the shell after installing Nix so nix is on PATH.
Clone the repository to the path configured by settings.nix, then build and activate the configured host:
CONFIG_HOST="$(nix eval --raw --file settings.nix hostname)"
nix build ".#darwinConfigurations.${CONFIG_HOST}.system"
sudo ./result/activateAfter activation, the included just helpers can be used:
just build
just switch
just updateThe drs shell function also rebuilds and activates the configured host from settings.nix.
flake.nix is generated. Update modules/inputs.nix, then run:
just write-flakeor:
nix run .#write-flake- The first build may require Xcode Command Line Tools for native packages or Homebrew integration.
- Homebrew taps include an internal Bitbucket tap; remove or replace it in
modules/programs/homebrew.nixif unavailable. - This configuration assumes a primary user managed by Den and Home Manager.
- Some GUI services, such as Yabai and SketchyBar, may require macOS accessibility permissions after activation.