Nix Darwin logo

Nix Darwin

Community
jpoehnelt
nix-darwin

Manage macOS system defaults, Homebrew casks, Lix or Nix daemon settings, and Home Manager packages and dotfiles with a nix-darwin flake. Use when adding packages or casks, changing macOS defaults or launchd agents, debugging flake evaluation or brew bundle failures, or activating changes from an agent shell.

Overview

Publisherjpoehnelt
Repositoryskills
Skill namenix-darwin
Stars
23
Forks
1
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by jpoehnelt on GitHub. Read the source before you install it.

Installation

Install the Nix Darwin AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/jpoehnelt/skills/tree/main/nix-darwin
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/jpoehnelt/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/nix-darwin .claude/skills/nix-darwin
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Nix Darwin in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Nix Darwin on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Nix Darwin is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

macOS configuration with nix-darwin

Declare all macOS system settings, packages, and dotfiles in the flake instead of running imperative installers or mutating local preference files by hand.

Repo facts (from AGENTS.md or CLAUDE.md): the flake directory path, the shared nix-darwin module path, the shared Home Manager module path, the per-host override directory, and how local secrets are stored.

Place each setting in the right layer

  • Put macOS system.defaults, PAM settings, /etc files, and GUI Homebrew casks in the nix-darwin module.
  • Put CLI packages, dotfiles, shell aliases, home.sessionVariables, and user launchd.agents in the Home Manager module.
  • Put user PATH additions in programs.zsh.initContent or zprofile instead of relying only on home.sessionPath in ~/.zshenv. macOS /etc/zprofile runs path_helper after ~/.zshenv, and login -pf preserves __HM_SESS_VARS_SOURCED.
  • Put machine-specific hardware mappings, computer names, and host-only packages in the host module.
  • Prefer Nix packages for CLI tools and language toolchains. Prefer Homebrew casks for GUI .app bundles that auto-update or need macOS code-signing entitlements.

Evaluate and build

  1. Stage any new file before evaluating the flake. Nix flakes ignore untracked Git files and fail with a missing-file error:
    bash
    git -C <flake-dir> add --intent-to-add <new-file>
  2. Check attribute names and option paths with nix eval before building the full system closure:
    bash
    nix eval <flake-dir>#darwinConfigurations.<host>.pkgs.<pkg>.version
  3. Build the host system closure without root privileges to catch module type errors and missing options early:
    bash
    nix build --no-link --print-out-paths <flake-dir>#darwinConfigurations.<host>.system
  4. If a macOS preference key has no typed option under system.defaults.<domain>, place it under system.defaults.CustomUserPreferences.<domain>.

Activate from an agent shell

An agent background shell has no controlling terminal app, so pam_tid.so skips Touch ID and sudo darwin-rebuild switch hangs waiting for a password on standard input.

  1. For Home Manager changes (CLI packages, dotfiles, environment variables, and user launchd agents), build and run the user activation package directly without sudo:
    bash
    HOST="$(scutil --get LocalHostName)"
    SYS_PATH="$(nix build --no-link --print-out-paths "<flake-dir>#darwinConfigurations.${HOST}.system")"
    ln -sfn "$(readlink -f "$SYS_PATH/etc/profiles/per-user/$USER")" "$HOME/.local/state/nix/profiles/profile"
    HM_ACTIVATE="$(nix build --no-link --print-out-paths "<flake-dir>#darwinConfigurations.${HOST}.config.home-manager.users.${USER}.home.activationPackage")"
    "$HM_ACTIVATE/activate"
    Use full paths such as /usr/bin/open, /usr/bin/pgrep, /usr/bin/defaults, and /usr/bin/security inside home.activation scripts, which run with a minimal PATH.
  2. For system.defaults changes that belong to the current user (such as com.apple.dock, com.apple.finder, or com.apple.screencapture), write the same plist key with defaults write and restart the affected service (killall Dock, killall Finder, or killall SystemUIServer) so the change takes effect immediately.
  3. For Homebrew casks, add the cask to homebrew.casks and run brew install --cask <cask> so the app installs right away. Pass --adopt if the .app bundle already exists in /Applications.
  4. For root-only changes (/etc, PAM, system daemons, or .pkg casks that prompt for sudo), ask the operator to run sudo darwin-rebuild switch in their terminal after nix build succeeds.

Secrets and Homebrew drift

  • Never write tokens or credentials into .nix files. Everything copied into /nix/store is world-readable on the machine and tracked in Git.
  • Store secrets in the macOS Keychain with security add-generic-password -U -a "$USER" -s "<service>" -w "<secret>". Read them at Home Manager activation or shell startup with security find-generic-password -a "$USER" -s "<service>" -w.
  • Set homebrew.onActivation.cleanup = "zap" when you want activation to remove undeclared Homebrew formulae and casks. Check brew list --formula and brew list --cask before enabling it for the first time.
  • If an external installer such as Lix or the Determinate Nix Installer manages the Nix daemon (nix.enable = false), put custom daemon settings in environment.etc."nix/nix.custom.conf" instead of nix.settings.

Verify

  • nix build --no-link <flake-dir>#darwinConfigurations.<host>.system exits 0 with no deprecation warnings.
  • User activation ($HM_ACTIVATE/activate) exits 0.
  • Installed binaries resolve on PATH, or changed preferences appear in defaults read.
  • git diff contains no plaintext tokens or machine-private credentials.

Frequently asked questions

What does the Nix Darwin AI skill do?

Manage macOS system defaults, Homebrew casks, Lix or Nix daemon settings, and Home Manager packages and dotfiles with a nix-darwin flake. Use when adding packages or casks, changing macOS defaults or launchd agents, debugging flake evaluation or brew bundle failures, or activating changes from an agent shell.

Why use Nix Darwin on TypingMind?

Because you install it once and use it with any model. Nix Darwin is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Nix Darwin in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/jpoehnelt/skills/tree/main/nix-darwin. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Nix Darwin?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Nix Darwin?

As many as you like. As long as a model supports skills, you can use Nix Darwin with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Nix Darwin AI skill free?

Yes. It is published on GitHub by jpoehnelt under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇