nixos-config: Skill for Claude Code

.claude/skills/rebuild/SKILL.md

rebuild is a skill for Claude Code from MCB-SMART-BOY/nixos-config. It costs 31 tokens per session (559 once invoked), scanned B, original, Apache-2.0.

A procedure for safely building, validating, activating, and rolling back a NixOS system configuration. NixOS is a Linux operating system managed through declarative configuration files.

In plain words
What is it for?
Use it to validate a NixOS flake, build or activate a system, apply changes after a restart when needed, test a virtual machine, inspect failed services, and return to an earlier system generation.
Why use it?
It reduces the risk of activating a broken configuration and provides checks and rollback steps when a deployment fails.

Skill for Claude Code

Written for Claude Code: installed under .claude/. Also seen: reads .claude/ paths.

This is MCB-SMART-BOY/nixos-config's own configuration. It tells Claude Code how to work on nixos-config itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything nixos-config configures →

Reuse

Borrowing it

Nothing to install: this file belongs to MCB-SMART-BOY/nixos-config. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/MCB-SMART-BOY/nixos-config/solo/.claude/skills/rebuild/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/MCB-SMART-BOY/nixos-config

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for rebuild

README.md
[![agentmods](https://agentmods.dev/badge/skills/mcb-smart-boy/nixos-config/rebuild/github.svg)](https://agentmods.dev/skills/mcb-smart-boy/nixos-config/rebuild)
Your own site
<a href="https://agentmods.dev/skills/mcb-smart-boy/nixos-config/rebuild"><img src="https://agentmods.dev/badge/skills/mcb-smart-boy/nixos-config/rebuild/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for rebuild

Your own site · 80×15
<a href="https://agentmods.dev/skills/mcb-smart-boy/nixos-config/rebuild"><img src="https://agentmods.dev/badge/skills/mcb-smart-boy/nixos-config/rebuild.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 31 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 559 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00031 $0.00559
Opus 5 $0.00015 $0.00280
Sonnet 5 $0.00006 $0.00112
Haiku 4.5 $0.00003 $0.00056

Measured 11d ago against content hash 3643cdea4408, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade B, and why

rebuild scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

sudo nixos-rebuild switch --flake /etc/nixos#nixos
.claude/skills/rebuild/SKILL.md · 65 lines

What it actually says

Rebuild

阶段 1:前置检查

.claude/skills/run-nixos-config/validate.sh
nix flake check                  # 完整 eval 检查(失败则停止!)
git status                       # 确认新增 tracked 文件已 git add

验证脚本先检查所有可部署机器都有已跟踪的 machines/<machine>/hardware-configuration.nix(排除仅求值的 ci_template),再从当前 checkout 完整求值。它不依赖 /etc/nixos 中私有的 local.nixhardware-gpu.nix

阶段 2:构建验证

当前机器:

nixos-rebuild build --flake /etc/nixos#nixos

其他机器将 nixos 替换为实际 flake 输出名 <machine>;不要使用 hostdefault 或主机名猜测输出。失败 → 进入 /debug

阶段 3:切换

sudo nixos-rebuild switch --flake /etc/nixos#nixos

部署其他机器时同样使用实际的 /etc/nixos#<machine> 输出;ci 仅求值,不可切换。

阶段 4:验证

systemctl --failed               # 检查失败服务
journalctl -u greetd -b          # 检查登录管理器

安全规则

  • 绝不nix flake check 失败时 switch
  • 绝不在构建失败时尝试 switch
  • 内核/initrd 变更 → 用 boot 而非 switch(重启后生效)
  • stateVersion → 警告用户不要改

回滚

sudo nixos-rebuild list-generations
sudo nixos-rebuild switch --rollback

特殊场景

nixos-rebuild build --flake /etc/nixos#nixos       # 只构建
sudo nixos-rebuild boot --flake /etc/nixos#nixos   # 下次重启生效
nixos-rebuild build-vm --flake /etc/nixos#nixos    # VM 测试
nix flake check                                     # 只检查
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 65 lines · 31 tokens per session scan B 3643cdea4408

Subscribe to this mod's changes

rebuild is a skill published in the GitHub repository MCB-SMART-BOY/nixos-config (10 stars, last pushed 5d ago), licensed Apache-2.0. It adds 31 tokens to every session and 559 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it B with 1 finding (asks for root). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

gke-compute-classes

Configures, optimizes, and troubleshoots GKE ComputeClasses. Use when configuring Spot VMs with on-demand fallback, targeting specific accelerators (GPUs/TPUs) or machine families, restricting ComputeClass access, or debugging pending pods related to node pool auto-creation. Do not use for cluster-level Node Auto…

google/skills · 83 tokens

gke-workload-security

Audits, configures, and hardens workload-level security controls for Google Kubernetes Engine (GKE) applications and namespaces. Covers running cluster security audits (auditcluster.sh), configuring Workload Identity Federation (impersonation, KSA/GSA binding, and pod setup), enforcing Network Policies (default-deny…

google/skills · 181 tokens

gke-reliability

Improves GKE workload reliability, using PDBs, health probes, and topology spread constraints. Use when configuring GKE workload reliability, setting up PDBs, or configuring GKE health probes (liveness, readiness, startup). Don't use for disaster recovery setup or full cluster backups (use gke-backup-dr instead).

google/skills · 73 tokens

nemo-automodel-launcher-config

Configure NeMo AutoModel job launches for interactive runs, Slurm clusters, and SkyPilot cloud execution.

NVIDIA/skills · 30 tokens

azure-mgmt-botservice-dotnet

Azure Resource Manager SDK for Bot Service in .NET. Management plane operations for creating and managing Azure Bot resources, channels (Teams, DirectLine, Slack), and connection settings. Triggers: "Bot Service", "BotResource", "Azure Bot", "DirectLine channel", "Teams channel", "bot management .NET", "create bot".

microsoft/skills · 78 tokens

cloud-architect

Designs cloud architectures, creates migration plans, generates cost optimization recommendations, and produces disaster recovery strategies across AWS, Azure, and GCP. Use when designing cloud architectures, planning migrations, or optimizing multi-cloud deployments. Invoke for Well-Architected Framework, cost…

Jeffallan/claude-skills · 71 tokens