Logo: Nix Darwin

Nix Darwin

Communautéit
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.

Iwwersiicht

Editeurjpoehnelt
Repositoryskills
Skill-Nummnix-darwin
Stären
23
Forks
1
Matgeliwwert Dateien
Nëmmen Instruktiounen
LizenzMIT
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • Alles an den Instruktiounen

    Alles, wat de Modell brauch, steet an den Instruktiounen — keng zousätzlech Dateien ze synchroniséieren.

  • Open Source

    jpoehnelt huet de Skill op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Nix Darwin an TypingMind, fir e mat all LLM ze benotzen, oder setzt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vu GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier, déi hei drënner steet, an a bestätegt d'Installatioun.
    https://github.com/jpoehnelt/skills/tree/main/nix-darwin
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill derbäisetzen → Iwwer eng GitHub-URL. Pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an d'Skill-Verzeechnes vun deem KI-Agent.

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
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Nix Darwin an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Nix Darwin automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Nix Darwin net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Schlësselen.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

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.

Heefeg gestallte Froen

Wat mécht de KI-Skill 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.

Firwat Nix Darwin op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Nix Darwin besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt, amplaz en Abonnement pro Benotzerplaz ze bezuelen. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Nix Darwin an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/jpoehnelt/skills/tree/main/nix-darwin an. TypingMind liest d'Datei SKILL.md an installéiert de Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Nix Darwin benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Nix Darwin benotzen?

Esou vill wéi Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Nix Darwin domat benotzen – zum Beispill mat GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Nix Darwin gratis?

Jo. jpoehnelt huet de Skill ënner der Lizenz MIT op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbare Pak vun Instruktiounen, deen engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt e maache soll a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a kee Lafzäitëmfeld a funktionéiere mat all Modell.

Alleguer weisen

Elo Ären eegene KI-Aarbechtsberäich ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇