recover-nixos-config SKILL.md skillA
recover-nixos-config from kihara777/nixkits is an agent skill: a SKILL.md folder an AI agent loads when a task calls for it.
mdr add kihara777/nixkits/recover-nixos-config@git:20260606.7dad578Pins git:20260606.7dad578 in mdr.lock. Pin the fingerprint instead.
- Audit grade
- A, 17 of 17 checks passed
- Kind
- SKILL.md skill
- Repository
- kihara777/nixkits
- Path
skills/recover-nixos-config/SKILL.md- Versions recorded
- 2
- Latest version
- git:20260606.7dad578, committed Jun 6, 2026
- First version recorded
- Jun 1, 2026
- Size
- 2,227 bytes
- Repository stars
- 28
- License
- MIT
当用户误删 /etc/nixos 目录下的文件(flake.nix、flake.lock 等)时,从 Nix store 中恢复。.
Collected from public GitHub. Every version is saved exactly as it was and never changes. Install it at an exact version with the mdr tool, and every file is checked before it reaches your agent. The main file is checked against the SHA-256 fingerprint recorded here, and the others against the fingerprints GitHub keeps for its source commit. The automatic checks below grade the latest version, and the same checks always give the same file the same grade.
What the file says
# 恢复误删的 /etc/nixos 文件 当 `/etc/nixos` 下的文件被误删,但 NixOS 系统此前已从该配置成功构建过, 则 flake 源码(包括 flake.nix、flake.lock 及所有本地模块)仍保留在 Nix store 中。 任何构建文件 — flake.nix、flake.lock、boot.nix、system.nix、home.nix 等 — 均可恢复。 ## 第 1 步:在 Nix store 中定位 flake 源码 Nix store 中保留了每次成功执行 `nixos-rebuild` 的 flake 源码快照。 按主机名搜索: ```bash grep -rl '<HOSTNAME>' /nix/store/*-source/flake.nix 2>/dev/null ``` 源码目录命名为 `*-source`,包含构建时 `/etc/nixos` 中的全部文件: - `flake.nix` - `flake.lock` - 所有本地 `.nix` 模块(boot.nix、home.nix、system.nix 等) ## 第 2 步:确认最新的 generation 在第 1 步的候选中找出最新 generation 的源码。最新的源码通常具有最大的 store path hash。如不确定,可将各候选的 `flake.nix` 与 `/etc/nixos` 中 尚存的文件对比 — 正确的源码会引用相同的本地模块 (如 `./boot.nix`、`./system.nix`)。 列出所有历史 generation: ```bash nixos-rebuild list-generations ``` 与当前 generation 匹配的源码目录包含构建当前运行系统的配置。 ## 第 3 步:验证内容 检查 `flake.nix` 的第一行以确认是正确的配置: ```bash head -1 /nix/store/<hash>-source/flake.nix ``` 列出源码中的所有文件: ```bash ls /nix/store/<hash>-source/ ``` ## 第 4 步:恢复已删除的文件 将需要的文件复制回 `/etc/nixos/`。仅恢复丢失的文件: ```bash cp /nix/store/<hash>-source/<filename> /etc/nixos/<filename> ``` 示例 — 仅恢复 flake.nix: ```bash cp /nix/store/<hash>-source/flake.nix /etc/nixos/flake.nix ``` 恢复多个文件: ```bash …
Read the whole file at its exact version.
How to install
mdr add kihara777/nixkits/recover-nixos-config@sha256:830b15329776fac9The line at the top of this page pins the label git:20260606.7dad578, which is what most people want. This one pins the sha256 fingerprint of the contents instead, so it survives a label being moved. Either way the exact version is written to mdr.lock, and mdr install downloads and checks those contents again, so it installs them exactly or stops with an error.
[](https://markdownregistry.com/a/art_usbyqlyrt2aanvar)
3 badge image fetches in 30 days. What the badge shows.
Versions
The registry has recorded 2 versions of this file, between Jun 1, 2026 and Jun 6, 2026, about one every 4 days.
| version | committed | commit | size | audit | |
|---|---|---|---|---|---|
| git:20260606.7dad578 latest | 2026-06-06 | 7dad578 | 2,227 B | A | view · diff |
| git:20260601.3be4889 | 2026-06-01 | 3be4889 | 2,434 B | A | view |
Audit of the latest version
- pass: Frontmatter block present
- pass: Frontmatter declares a name
- pass: Frontmatter declares a description
- pass: Size between 200 bytes and 200 KB (2227 bytes)
- pass: No zero-width or bidi control characters
- pass: No instruction hidden inside an HTML comment
- pass: No link to an exfiltration or paste host
- pass: No credential-shaped string
- pass: No instruction to send local credentials anywhere
- pass: No text hidden with inline styles
- pass: No prompt-injection phrasing
- pass: No curl or wget piped into a shell
- pass: No recursive delete of root, home or parent
- pass: No instruction to read or print local credentials
- pass: No base64 blob over 200 characters
- pass: No link to a raw IP address
- pass: No script tag
Source
kihara777/nixkits · 28 stars · license MIT · pushed 2026-11-06 · branch main
API
GET https://markdownregistry.com/api/v1/artifacts/art_usbyqlyrt2aanvar GET https://markdownregistry.com/api/v1/resolve?ref=kihara777/nixkits/recover-nixos-config GET https://markdownregistry.com/api/v1/blob/830b15329776fac965fef2bd24f6bb10f60b320cc0178a6a3ae70fc69f8da04d
Your AI assistant does the legwork. You hear about the deals worth your word. Hand yours the standing instructions at modelranch.com and it joins the network that reads files like this one.
Guides: the SKILL.md format and its required fields · what to check before you install a skill · how to pin a skill to an exact version · where to find agent skills · keeping a team on the same skills · which agent file does what.