一键导入
run-nixos-config
Validate, build, and deploy the NixOS configuration. Use when asked to run, build, check, validate, verify, test, or deploy the NixOS config.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Validate, build, and deploy the NixOS configuration. Use when asked to run, build, check, validate, verify, test, or deploy the NixOS config.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Create or edit NixOS/Home Manager modules. Use when asked to create modules, add new modules, split modules, or manage the module architecture.
Manage system and user software packages, profiles, and overlays. Use when asked to install, add, remove, change software, enable/disable profiles, or manage Flatpak apps.
Refactor NixOS configuration — extract modules, clean up, remove dead code, consolidate duplicates. Use when asked to refactor, split, clean, reorganize, optimize, or consolidate Nix config.
Manage NixOS users — add, remove, or modify user configurations. Use when asked to add users, create users, manage users, set up multi-user, or configure profiles and dotfiles.
Safely rebuild and deploy the NixOS system. Use when asked to rebuild, switch, deploy, apply configuration, or activate changes.
Debug Nix build failures, eval errors, and runtime issues. Use when asked to debug, fix errors, troubleshoot, diagnose build/eval failures, greetd crashes, or systemd failed services.
| name | run-nixos-config |
| description | Validate, build, and deploy the NixOS configuration. Use when asked to run, build, check, validate, verify, test, or deploy the NixOS config. |
Paths relative to repo root.
.claude/skills/run-nixos-config/validate.sh # 全部检查
.claude/skills/run-nixos-config/validate.sh --check statix # 单项检查
.claude/skills/run-nixos-config/validate.sh --check nixos-eval # 完整 flake 求值
.claude/skills/run-nixos-config/validate.sh --quick # 仅格式检查
完整流程依次运行 nix-fmt、statix、deadnix、shell-syntax 和 nix flake check。nixos-eval 开始前会检查每个可部署的 machines/<machine>/hardware-configuration.nix 已存在;ci(仅求值)和 _template 不参与硬件检查。
硬件配置由仓库直接跟踪并导入,因此完整求值只依赖当前 checkout,不要求宿主是 NixOS,也不读取 /etc/nixos 中私有的 local.nix 或 hardware-gpu.nix。
validate.sh / nix flake check 会格式化、静态检查并求值 system.build.toplevel.drvPath,但不会实现完整系统 closurenix build --no-link .#nixosConfigurations.<machine>.config.system.build.toplevel 或 nixos-rebuild buildnix build --dry-run;它会显示待构建派生、下载路径和体积。需要实时日志时加 -L当前机器的可执行部署命令:
./run.sh deploy --host nixos
sudo nixos-rebuild switch --flake /etc/nixos#nixos
其他可部署输出使用 /etc/nixos#<machine>;ci 仅供求值,不能部署。
nix --extra-experimental-features 'nix-command flakes' develop
nixfmt --checkgit addlocal.nix 与 hardware-gpu.nix 保持 gitignored、可选,不是仓库求值前提