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.

Install it, pinned
mdr add kihara777/nixkits/recover-nixos-config@git:20260606.7dad578

Pins 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

The exact contents, by fingerprint
mdr add kihara777/nixkits/recover-nixos-config@sha256:830b15329776fac9

The 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.

Badge

mdr badge

[![mdr](https://markdownregistry.com/badge/art_usbyqlyrt2aanvar.svg)](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.

versioncommittedcommitsizeaudit
git:20260606.7dad578 latest2026-06-06 7dad578 2,227 BA view · diff
git:20260601.3be48892026-06-01 3be4889 2,434 BA view

Audit of the latest version

A  17 of 17 checks passed. Fixed automatic checks with no AI involved, so the same checks give the same answer every run.
  • 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

GitHub

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.

More from kihara777/nixkits

AGENTS.md AGENTS.md file
kihara777/nixkits · AGENTS.md
git:20261026.93adc54 · audit A · 28 stars
news-three-elements SKILL.md skill
kihara777/nixkits · packages/dsh-preset-news-three-elements/bundled/news-three-elements/SKILL.md · 以真实通讯社新闻格式编造「催逝快讯」——本技能里的「新闻三要素」不指新闻学那三样,而是三位必须到场的主角:巴兰尼科夫、尤丁采夫、布亚诺夫。触发词「新闻三要素」;含素材搜索、格式硬性要求、用语模板、宽松的拒绝服务判定(先当素材,接不回来才拒)…
git:20260915.a0759b1 · audit A · 28 stars
agent-self-maintenance SKILL.md skill
kihara777/nixkits · skills/agent-self-maintenance/SKILL.md · 用五个「会失败」的小机制让 AI 编码助手长期维护自己的记忆——日记闸门、开局对账、事实核查、自我观察、自检收据。适用于任何有 journal/ 与自检脚本的仓库;含各机制的判据与边界(目录缺失时说什么、数据为什么不能随机制搬走)。
git:20261104.8c7c4cc · audit A · 28 stars
news-three-elements SKILL.md skill
kihara777/nixkits · skills/news-three-elements/SKILL.md · 以真实通讯社新闻格式编造「催逝快讯」——本技能里的「新闻三要素」不指新闻学那三样,而是三位必须到场的主角:巴兰尼科夫、尤丁采夫、布亚诺夫。触发词「新闻三要素」;含素材搜索、格式硬性要求、用语模板、宽松的拒绝服务判定(先当素材,接不回来才拒)…
git:20260915.a0759b1 · audit A · 28 stars
nix-flake-update-check SKILL.md skill
kihara777/nixkits · skills/nix-flake-update-check/SKILL.md · 检查任意 nix flake 仓库中软件包的上游版本更新并升级——开工前先同步远端并核对活跃 issue / PR、按包型(npm / cmake / Rust / fetchurl / python)分流的 hash 更新流程与自托管…
git:20261022.edd2bef · audit A · 28 stars
nix-packaging SKILL.md skill
kihara777/nixkits · skills/nix-packaging/SKILL.md · 从零把一个上游软件打包成 Nix 表达式——按来源类型分流(GitHub 源码 / npm / Rust / 预编译二进制 / Gitea)、hash 的两段式获取(fakeHash → 读取 got → 回填 →…
git:20261024.8b180c4 · audit A · 28 stars
nixkits-check-updates SKILL.md skill
kihara777/nixkits · skills/nixkits-check-updates/SKILL.md · NixKits 仓库的软件包更新适配层——在通用技能 nix-flake-update-check 之上,补充本仓库特有的远端 issue / PR 形态(含与更新重叠的历史先例)、CI 结构(可复用 build-package.yml…
git:20261022.b63b636 · audit A · 28 stars
nixkits-package-upstream SKILL.md skill
kihara777/nixkits · skills/nixkits-package-upstream/SKILL.md · NixKits 的 nixpkgs 上游贡献适配层——在通用技能 upstream-audit 之上,补充本仓特有的环节:13 个包的可行性台账(谁已进 nixpkgs、谁有在途…
git:20261022.d025ef6 · audit A · 28 stars
nixkits-skills SKILL.md skill
kihara777/nixkits · skills/nixkits-skills/SKILL.md · 将 NixKits 技能安装或更新到编码助手目录(opencode、codewhale、codex、openclaw、agents)。支持本地和在线两种安装模式。DeepSeek Harness (dsh) 不再作为安装目标——其…
git:20261020.2e66963 · audit A · 28 stars
nixos-modern-cli SKILL.md skill
kihara777/nixkits · skills/nixos-modern-cli/SKILL.md · 在 NixOS 系统上工作时使用。确保正确使用现代 Nix/NixOS CLI、完整的 shell 能力、sudo 权限和正确的系统维护流程;含 Nix store 路径陷阱与密钥/`path:` input 的仓库外组织方式。
git:20260916.a33a3cf · audit A · 28 stars
nixos-specialisation-tuning SKILL.md skill
kihara777/nixkits · skills/nixos-specialisation-tuning/SKILL.md · 为 NixOS 设计 specialisation 分面(默认 headless + 可选桌面),并在统一内存(UMA)设备上调优 llama.cpp 本地推理。覆盖分面架构、引导菜单与默认面、分面切换后的运行级收敛与用户级…
git:20260922.8c276c0 · audit A · 28 stars
translate-pseudocn SKILL.md skill
kihara777/nixkits · skills/translate-pseudocn/SKILL.md · 为文档撰写技能提供伪中国语(pcn)语言支持。以日语汉字词汇为基础、剥离平假名与片假名、保留日语语序的伪本地化。可被 write-project-docs 自动发现调用。
git:20260920.dac80a7 · audit A · 28 stars

Every file in kihara777/nixkits

Browse by kind, by grade A, or by owner.