Logo: Nixos Managing

Nixos Managing

Communautéit
michalzubkowicz
nixos-managing

Use when managing NixOS systems — rebuilding, configuring, deploying, installing, or building images. Covers flakes, modules, secret management, VM management, disk imaging, remote deployment, and common anti-patterns to avoid.

Iwwersiicht

Editeurmichalzubkowicz
Repositorynixos-management-skill
Skill-Nummnixos-managing
Stären
67
Forks
1
Matgeliwwert Dateien
8
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.

  • 8 matgeliwwert Dateien

    Skripten, Virlagen a Referenzen, déi de Modell beim Schaffe liese kann. D'Dateie kënnen nëmme gelies ginn a ginn ni ausgeféiert.

  • Open Source

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

Installatioun

Installéiert de KI-Skill Nixos Managing 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/michalzubkowicz/nixos-management-skill/tree/main/nixos-managing
  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/michalzubkowicz/nixos-management-skill.git /tmp/nixos-management-skill
mkdir -p .claude/skills
cp -r /tmp/nixos-management-skill/nixos-managing .claude/skills/nixos-managing
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Nixos Managing 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 Nixos Managing automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Nixos Managing 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.

NixOS Management

Quick Decision: What do you need?

TaskGo to
Rebuild / activate / rollback systemvm-management.md
Install NixOS on new machineinstallation.md
Build ISO / disk image / VM imageimage-building.md
Configure modules, flakes, packages, servicesconfiguration.md
Ephemeral root / wipe on boot / impermanenceimpermanence.md
LUKS encryption / remote unlock (SSH, Tailscale)luks.md
Health checks / Telegram (or webhook) alerts for filesystem, disk, SMART, servicesmonitoring.md
Something isn't working / weird behavioranti-patterns.md

Execution Context — Ask First

Before suggesting any commands, establish where they will run.

NixOS management involves multiple machines. Commands that work on the NixOS host will fail on macOS or non-NixOS Linux. Always determine the setup before suggesting commands.

If unsure — ask: "Where are you editing configs, and where does nixos-rebuild run?"

All common setups

Setup A — NixOS local (everything on one machine)

NixOS machine: edit → nixos-rebuild switch (local)
  • All commands run locally
  • nixos-option, man configuration.nix, nixos-rebuild — all local

Setup B — NixOS workstation → NixOS remote server

NixOS workstation (edit) → nixos-rebuild --target-host → NixOS server
  • nixos-rebuild runs on workstation, deploys to server
  • Option verification: workstation (has nixpkgs) or server via SSH
  • nixos-option on server reflects what's actually active there

Setup C — macOS → NixOS remote (Linux rebuilds locally)

macOS (edit .nix files) → push/rsync → NixOS Linux host → nixos-rebuild switch (local)
  • nixos-rebuild runs on the Linux host (SSH in, or via remote trigger)
  • Option verification: SSH into Linux host — macOS has no nixos-option
  • search.nixos.org/options always works from macOS

Setup D — macOS → NixOS remote (macOS drives rebuild)

macOS (edit) → nixos-rebuild --target-host root@linux-host --flake .#host
  • nixos-rebuild runs on macOS but activates on Linux
  • Requires Nix installed on macOS (nix CLI, not NixOS)
  • Option verification: nix eval works on macOS if Nix is installed; otherwise use search.nixos.org

Setup E — Linux (non-NixOS) → NixOS remote

Ubuntu/Debian/Arch (edit + run nixos-rebuild) → NixOS remote server
  • Same as Setup D — Nix must be installed on the source machine
  • nixos-option not available unless NixOS; use nix eval or search.nixos.org

Setup F — CI/CD → NixOS remote

CI agent (GitHub Actions / GitLab CI) → deploy to NixOS server
  • CI agent needs Nix installed (use cachix/install-nix-action or similar)
  • No interactive verification — all options must be pre-validated
  • Use nix flake check in CI to catch errors before deploy

Verification availability by machine type

Machinenixos-optionnix eval nixpkgs#...man configuration.nixsearch.nixos.org
NixOS host✅✅✅✅
macOS with Nix❌✅❌✅
Linux (non-NixOS) with Nix❌✅❌✅
macOS without Nix❌❌❌✅
CI agent with Nix❌✅❌✅

MCP Server: mcp-nixos (optional accelerator)

If the mcp-nixos MCP server (utensils/mcp-nixos) is configured in the environment, prefer it for lookups over SSH/web round-trips — but ask the user first before using it for a given task: "I can use the mcp-nixos MCP server to look this up directly — want me to use it?"

What it's good at:

  • Exact NixOS package names, versions, metadata (130K+ packages)
  • NixOS options (23K+) — verify option paths before suggesting config
  • Home Manager options (5K+)
  • nix-darwin macOS settings (1K+)
  • Nixvim Neovim configuration (5K+)
  • FlakeHub registry discovery (600+ flakes)
  • Noogle Nix function lookup (2K+)
  • NixOS Wiki / nix.dev documentation
  • Binary cache status checks
  • Local flake input exploration
  • Package version history with nixpkgs commit hashes (reproducible pins)

Use it instead of: guessing option names, scraping search.nixos.org, or SSHing into a host just to run nixos-option. Works on macOS without Nix installed.

Tools exposed: nix (unified query), nix_versions (version history).

When NOT to ask: the user has already said they want (or don't want) to use it this session — honor that preference.

Before installing — security review required. Any MCP server runs with your shell privileges. Before adding mcp-nixos (or any MCP) to the configuration:

  1. Download the source (git clone https://github.com/utensils/mcp-nixos or inspect the PyPI tarball via uvx --from mcp-nixos --print / pip download mcp-nixos --no-deps).
  2. Review it for anything harmful: unexpected network endpoints, filesystem writes outside its own cache, shell/exec calls, credential reads (~/.ssh, ~/.aws, env vars), obfuscated code, suspicious post-install hooks in pyproject.toml / setup.py.
  3. Pin to a known-good version/commit rather than a floating tag.
  4. Only after review — add it to the MCP config.

Tell the user what you reviewed and what you found before they approve the install.

Option Verification — Always Verify Before Suggesting

Never suggest a NixOS option from memory alone. Option names change between NixOS versions, and incorrect options fail silently or produce confusing errors.

Fastest path (if available): the mcp-nixos MCP server — see section above. Ask the user before using it.

Run on the NixOS host (not macOS, not CI unless it runs NixOS):

bash
# Search available options interactively
nixos-option services.openssh.settings

# Evaluate option existence in current nixpkgs
nix eval nixpkgs#nixosOptionsDoc --apply 'x: builtins.attrNames x' 2>/dev/null | grep -o '"[^"]*PasswordAuth[^"]*"'

# Quickest: man page on the NixOS machine
man configuration.nix | grep -A3 "PasswordAuthentication"

Or use the web (version-specific, always available):

  • https://search.nixos.org/options — search by option name, filterable by channel
  • Check the channel matching your nixpkgs.url (e.g. nixos-26.05)

Workflow when unsure about an option:

  1. Check search.nixos.org/options for the option name and correct path
  2. Note the NixOS version it applies to
  3. Only then include it in configuration

Core Mental Model

NixOS is declarative and atomic. Every change produces a new generation. You can always roll back.

Key workflow:

  1. Edit .nix files
  2. git add (in flakes — untracked files are invisible to Nix)
  3. nixos-rebuild test (activate without committing to bootloader)
  4. nixos-rebuild switch (set as default boot)

Flakes vs Channels

Use flakes for reproducibility. Channels are impure (machine-dependent lookup paths).

Enable flakes once:

nix
nix.settings.experimental-features = [ "nix-command" "flakes" ];

Common nixos-rebuild Commands

CommandWhen to use
nixos-rebuild switchApply + set as default boot
nixos-rebuild testApply now, skip bootloader — safe first step
nixos-rebuild bootSet as next boot without activating now
nixos-rebuild dry-activatePreview changes without applying
nixos-rebuild buildBuild only, creates ./result
nixos-rebuild build-vmBuild QEMU VM for local testing

Always test before switch — especially on remote servers:

bash
nixos-rebuild test --flake .#hostname --target-host root@server
nixos-rebuild switch --flake .#hostname --target-host root@server

Remote Deployment Tools

ToolBest for
nixos-rebuild --target-host1-3 machines, simplest
deploy-rsSmall fleet, auto-rollback on failure
colmenaLarge fleet, parallel, cross-host config
nixos-anywhereInitial install on non-NixOS machine

Secret Management

ToolWhen to use
agenixSimple setup, SSH key workflow, small secret count
sops-nixCloud KMS needed, templating, multiple formats

Secrets live at /run/agenix/ or /run/secrets/ — never in Nix store.

Most Frequently Changed Elements

  • environment.systemPackages — installed packages
  • users.users.<name> — user accounts and SSH keys
  • networking.* — hostname, IPs, firewall ports
  • services.* — enable/configure systemd services
  • boot.loader.* — bootloader and kernel settings
  • nix.settings.* — substituters, trusted users, features

See configuration.md for patterns.

Matgeliwwert Dateien

De Modell liest dës Dateie bei Bedarf, wärend de Skill gelueden ass. Si ginn als liesbar Dateie bereetgestallt a ginn ni ausgeféiert.

Heefeg gestallte Froen

Wat mécht de KI-Skill Nixos Managing?

Use when managing NixOS systems — rebuilding, configuring, deploying, installing, or building images. Covers flakes, modules, secret management, VM management, disk imaging, remote deployment, and common anti-patterns to avoid.

Firwat Nixos Managing op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Nixos Managing 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 Nixos Managing an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/michalzubkowicz/nixos-management-skill/tree/main/nixos-managing an. TypingMind liest d'Datei SKILL.md, bëndelt déi zougehéiereg Dateien an installéiert dat Ganzt als Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Nixos Managing 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 Nixos Managing benotzen?

Esou vill wéi Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Nixos Managing 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 Nixos Managing gratis?

Jo. michalzubkowicz 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 👇