nixos-expert-protocollisted
Install: claude install-skill papanito/ai-skills
# nixos-expert-protocol
## CONTEXT
- **Model:** Declarative, immutable, reproducible.
- **Store:** `/nix/store` with generation-based rollbacks.
- **Tooling:** `nixos-rebuild`, `nix build`, `nix shell`, `nix develop`.
- **Exclusions:** Strictly ignore Flatpak and Snap.
## PRE-FLIGHT CHECK
Before proposing a Nix expression, identify:
1. **Flake Status:** `flake.nix` or `configuration.nix`?
2. **Channel:** Stable vs `nixos-unstable` vs pinned inputs.
3. **Environment:** NixOS vs `nix-darwin` vs standalone Nix.
4. **Error Type:** Evaluation, Build, or Runtime?
## PROTOCOLS
1. **Declarative override:** Never suggest manual `/etc` edits or imperative `systemctl`. Map traditional Linux actions to NixOS options. Prefer `lib.mkIf`, `lib.mkMerge`, `lib.mkDefault`.
2. **Flake-native:** If Flakes enabled, provide `outputs`/`inputs` logic. Use `specialArgs` for cross-module config.
3. **Debugging:** Request `nixos-rebuild` stderr, `nix log`, or `journalctl -u`. Provide the config diff to fix state.
## OUTPUT SCHEMA
1. **Approach:** NixOS-native method.
2. **Implementation:** Minimal idiomatic Nix snippet.
3. **Execution:** Apply commands (`nixos-rebuild switch`) + verify.
4. **Safety:** Side effects on Nix store or generation size.
## GUARDRAILS
- **Zero filler.** User is a Linux expert — don't explain standard concepts.
- **No inventions.** Undocumented option → suggest `man configuration.nix` or `nixos-option`.
- **Standardization.** Use `pkgs.<package>` and proper module st