nix-flake-development
Skill1 starsChanged 28 days agoMITView on GitHub
Use when editing ~/nixos-config, adding a NixOS or Home Manager module, updating a flake input, running its nixos:qa verification gate, or rebuilding/deploying a homelab host.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- sammasak/skillsword for word, first seen Oct 17, 2026
Other versions1 project uses a version of this.
Word for word · 1
- sammasak/skills★ 1100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository25 other files it gives its agents.
- agent-handoffSkill
- agent-orchestrationSkill
- assigning-subagent-modelsSkill
- credentialsSkill
- deep-modulesSkill
- device-protocol-investigationSkill
- e2e-testingSkill
- herdr-operationsSkill
- herdrSkill
- knowledge-vaultSkill
- kubernetes-gitopsSkill
- lean-codeSkill
- nix-audit-operatorSkill
- ntfy-notificationsSkill
- orchestrated-reviewSkill
- pcap-evidence-analysisSkill
- pi-offloadSkill
- pi-ticketSkill
- rf-chaos-experiment-reviewSkill
- rust-engineeringSkill
- sdlc-pipelineSkill
- secrets-managementSkill
- tooling-feedbackSkill
- verify-serviceSkill
- wireless-lab-diagnosticsSkill
The file
Files
Nix Flake Development (homelab)
~/nixos-config (branch main) is flake-parts with auto-discovery: flake-modules/ loads in numbered order, modules/roles/*.nix and modules/home/*.nix become registry modules automatically, hosts are declared in flake-modules/hosts/<name>.nix + hosts/<name>/. Home Manager is shared by every host via modules/home/default.nix. Its CLAUDE.md is the detailed reference, including a Comment Policy that just lint-comments enforces.
Hosts
Flake attributes: acer-swift, lenovo (hostname lenovo-21CB001PMX), msi-ms7758, black-pi (aarch64 Raspberry Pi 4; eval-only on lenovo, builds on the Pi), naked-pi (Pi 3 rf-lab, off k3s). The Justfile maps hostname to attribute, so just switch with no argument targets the current machine.
Commands
devenv tasks run nixos:qa # the verification gate (= just check; pre-push runs it on the pushed sha)
# includes nixos:verify = builds every x86 host: heavy, take the lock below
just verify # every host builds
just diff [HOST] # nh build + package diff vs the running system
just switch [HOST] # nixos-rebuild switch --install-bootloader
just bump [input] # nix flake update (all or one input)
just deploy-acer # deploy-rs with magic rollback; acer has no BMC, so prove on deploy-lenovo first
just deploy-pi # deploy-rs remoteBuild: the Pi builds its own closure (lenovo has no aarch64 builder)Run heavy gates on a host with free capacity (not a full Lenovo root, not next to another session's build) under its shared lock: flock /tmp/$(hostname)-heavy-work.lock devenv tasks run nixos:qa. Eval-only and script gates (nix eval, a module's regression script, nix flake check with no builds) take the light lane instead, flock -w 900 /tmp/$(hostname)-light-work.lock ..., so they never queue behind a build. Before rerunning a full gate on a head someone already ran it on, devenv tasks run gate:verify --input gate=<gate> (devenv-platform gate records) and rerun only the probes the review needs. Prefer the narrow task (nixos:lint-shell, nixos:flake-check, a module's own regression script) when it covers the change.
Switching and rollback are operator actions. Do not run just switch, a just deploy-* or a generation rollback unless the owner asked for that host now; hand over the exact command and keep the previous generation available. Never switch while an agent session depends on the current shell environment.
Known traps
- Bootloader:
lenovoandacer-swiftuse systemd-boot;msi-ms7758is GRUB with a Windows chainload entry (small shared ESP);black-piis U-Boot + extlinux.just switchalways passes--install-bootloader; before a flake update, check whether the bootloader/kernel store paths change. - A rebuild or HM switch breaks the Bash tool in every running Claude session (stale shell snapshots: exit 1, no output). File tools keep working; restart the session. Park state outside the
/tmpscratchpad first. - The build uses the commit pinned in
flake.lock; pushing a dependency repo changes nothing untiljust bump <input>. Skills reach~/.claude,~/.codex/skillsand~/.agents/skillsthis way: merge tosammasak/skills, thenjust bump skills(owner approval) and switch. Never edit those skill dirs directly (HM symlinks into the store). git+inputs to private repos need ssh URLs (github:404s without a token) and a?rev=pin.- Secrets: sops-nix with rules in
secrets/.sops.yaml; seesecrets-management. - Fish wrappers for
claude/codex: on devTools hosts native telemetry may only add function-localset -lxsettings vialib.mkBefore; Herdr's function stays the sole dispatcher. Never append anotherclaude/codexcommand: Fish function bodies concatenate and the agent runs twice (the defect on main today). The fix and its no-inference regression are in PR #95 (open); once merged:nixpkgs_source=$(nix eval --raw --impure --expr '(builtins.getFlake (toString ./.)).inputs.nixpkgs.outPath'), thenpython3 scripts/test-native-otel-fish.py "$nixpkgs_source"(every case printsPASS:, exit 0), and the same test joinsnixos:qa. - Native telemetry activation or rollback happens only after approval, with agent sessions parked: Lenovo canary first, a fresh shell, one version line per
claude --version/codex --version(no inference; does not prove telemetry receipt). Safe rollback isnativeOtel = falseplus an approved switch, never a switch back to a pre-fixnativeOtel = truegeneration; do not revoke a credential another approved client shares. - black-pi: its nix-daemon ignores
--max-jobs/--coresfrom untrustedlukas; the host sets max-jobs 1 / cores 2, realise any big build before that is live as root (systemd-run … nix-store --realise <drv> --max-jobs 1 --cores 2) or the 4GB Pi hangs. Runbook:~/knowledge/homelab/runbooks/aarch64-pi-host.md.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

