Logo di Nix Darwin

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.

Panoramica

Pubblicato dajpoehnelt
Repositoryskills
Nome della skillnix-darwin
Stelle
23
Fork
1
File inclusi
Solo istruzioni
LicenzaMIT
Link
  • Istruzioni in Markdown

    Un file SKILL.md che il modello carica quando serve, consumando token solo quando una richiesta è effettivamente pertinente.

  • Funziona con qualsiasi LLM

    Le skill IA sono in semplice Markdown, non in codice specifico di un fornitore, quindi funzionano con GPT, Claude, Gemini, Grok o un modello locale.

  • Tutto nelle istruzioni

    Tutto ciò che serve al modello è nelle istruzioni: nessun file aggiuntivo da sincronizzare.

  • Open source

    Pubblicata da jpoehnelt su GitHub. Leggi i sorgenti prima di installarla.

Installazione

Installa la skill IA Nix Darwin in TypingMind per usarla con qualsiasi LLM, oppure copiala in un altro agente in grado di leggere SKILL.md.

1

Installa in TypingMind

TypingMind installa una skill direttamente dalla sua cartella GitHub: legge SKILL.md, raccoglie i file delle risorse e salva il risultato in locale.

  1. Apri l'app e vai su Plugin → Skill.
  2. Scegli "Installa da GitHub".
  3. Incolla l'URL della cartella della skill riportato qui sotto e conferma.
    https://github.com/jpoehnelt/skills/tree/main/nix-darwin
  4. Attiva la skill in ogni chat in cui vuoi averla a disposizione.
Plugin → Skill → Aggiungi skill → Da URL GitHub, poi incolla l'URL della cartella e premi Continua.
2

Installa in un altro agente

Qualsiasi agente che legge il formato Agent Skills può usare questa skill: copia la cartella della skill nella directory delle skill di quell'agente.

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
Dopo la copia, riavvia Claude Code per caricare la nuova skill.

Usala in TypingMind

Attiva Nix Darwin in qualsiasi chat di TypingMind e al resto pensa il modello. Il nome e la descrizione della skill sono nel prompt di sistema e, non appena arriva una richiesta pertinente, il modello carica da solo le istruzioni complete: non devi mai richiamarla manualmente e non consuma token finché non viene effettivamente usata.

Il modello carica automaticamente Nix Darwin non appena riceve una richiesta pertinente.

Funziona con qualsiasi modello IA

Le skill IA sono semplici istruzioni in Markdown, non codice specifico di un fornitore, quindi Nix Darwin non è vincolata al modello per cui è stata scritta. Installala una sola volta in TypingMind e usala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modello locale che esegui tu, sempre con le tue chiavi API.

  • Caricata solo quando serve

    Il prompt di sistema contiene solo il nome e la descrizione. Le istruzioni vengono recuperate alla prima richiesta pertinente, quindi una skill inutilizzata non costa nulla.

  • Cambia modello durante la chat

    Poiché la skill è composta da istruzioni e non da codice, continua a funzionare anche se cambi modello: il nuovo modello legge lo stesso file SKILL.md.

Istruzioni della skill

Questo è il contenuto di SKILL.md che il modello carica. Leggilo prima dell'installazione: una skill è un insieme di istruzioni che il tuo modello seguirà.

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.

Domande frequenti

Cosa fa la skill IA 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.

Perché usare Nix Darwin su TypingMind?

Perché la installi una volta e la usi con qualsiasi modello. Nix Darwin è scritta in semplice Markdown anziché in codice specifico di un fornitore, quindi la stessa skill funziona con GPT-5, Claude, Gemini, Grok o un modello locale, e puoi cambiare modello durante la chat senza che la skill smetta di funzionare. TypingMind usa le tue chiavi API, quindi paghi direttamente i fornitori anziché un abbonamento per posto utente, e le tue skill e chat restano nel tuo spazio di archiviazione.

Come installo Nix Darwin in TypingMind?

Apri Plugin → Skill → Installa da GitHub in TypingMind e incolla https://github.com/jpoehnelt/skills/tree/main/nix-darwin. TypingMind legge il file SKILL.md e installa la skill, che puoi abilitare per ogni singola chat.

Quali modelli IA possono usare Nix Darwin?

Qualsiasi modello che colleghi a TypingMind. Le skill IA sono semplici istruzioni in Markdown anziché codice specifico di un fornitore, quindi GPT, Claude, Gemini, Grok e i modelli locali possono tutti caricare questa skill quando una richiesta corrisponde al suo scopo.

Quanti modelli IA posso usare con Nix Darwin?

Quanti ne vuoi. Se un modello supporta le skill, puoi usarlo con Nix Darwin: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e molti altri, tutti su TypingMind con le tue chiavi API.

La skill IA Nix Darwin è gratuita?

Sì. È pubblicata su GitHub da jpoehnelt con licenza MIT. Paghi solo il tuo fornitore IA per i token che usi.

Cosa sono le skill IA?

Una skill IA è un pacchetto di istruzioni riutilizzabili che insegna a un modello IA come svolgere un'attività specifica. Segue il formato aperto Agent Skills: un file SKILL.md con un nome e una descrizione, più eventuali script, template o file di riferimento di cui il modello potrebbe aver bisogno. Il modello legge le istruzioni solo quando la tua richiesta corrisponde alla skill, quindi una skill installata non comporta costi finché non viene usata.

In cosa si differenziano le skill IA dai plugin o dai server MCP?

Un plugin o un server MCP fornisce a un modello nuovi strumenti da richiamare: codice che viene eseguito da qualche parte e restituisce un risultato. Una skill IA, invece, fornisce al modello conoscenze e procedure: come affrontare un'attività, quali passaggi seguire e quali caratteristiche deve avere un buon output. Le skill sono semplici istruzioni in Markdown, quindi non richiedono server, chiavi API né ambienti di esecuzione e funzionano con qualsiasi modello.

Elenco completo

Crea subito il tuo spazio di lavoro AI

Iscriviti alla nostra newsletter per ricevere aggiornamenti sulle nuove funzionalità e sulle prossime iniziative a premi 👇