agentleFS
bolivian-perubolivian-peru/os-moda/skills/nix-optimizer/SKILL.md

nix-optimizer

Skill118 starsChanged 6 months agoApache-2.0View on GitHub

Intelligent Nix store management. Analyze store usage, identify waste, optimize garbage collection, and track generation history.

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Don't just nix-collect-garbage -d.

    line 27

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Nix Store Optimizer

Intelligent garbage collection and store management.

Store Analysis

shell_exec({ command: "du -sh /nix/store 2>/dev/null" })
shell_exec({ command: "nix-store --gc --print-dead 2>/dev/null | wc -l" })
shell_exec({ command: "nixos-rebuild list-generations 2>/dev/null | tail -20" })

Smart GC Strategy

Don't just nix-collect-garbage -d. Be intelligent:

  1. Always keep: current generation, last known-good, backup baseline
  2. Analyze: which generations introduced large store additions
  3. Recommend: targeted cleanup with estimated space recovery
Nix Store Report:

Store size: 28.4 GB across 47 generations

Recommended to keep:
  Gen 50 (current) — 12.1 GB active
  Gen 47 (pre-OpenSSL update) — rollback point
  Gen 42 (last backup baseline)

Safe to remove: 44 generations → reclaims ~19 GB

Large items:
  /nix/store/...-linux-6.6.12 (old kernel) — 980 MB
  /nix/store/...-chromium-121 (old browser) — 1.4 GB
  /nix/store/...-texlive-2023 (unused) — 2.1 GB

Proceed with smart cleanup?

Execution

shell_exec({ command: "nix-collect-garbage --delete-older-than 14d" })
shell_exec({ command: "nix-store --optimise" })  # dedup hardlinks

Post-Cleanup

memory_store({
  summary: "Nix GC: freed 19GB, kept gens 42,47,50",
  detail: "Store reduced from 28.4GB to 9.3GB. 44 generations removed.",
  category: "system.config",
  tags: "nix,garbage-collection,optimization"
})

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.