nix-optimizer

Analyze Nix store disk usage and perform targeted garbage collection.

113|21|Updated Feb 20, 2026
One-click install
npx skills add https://github.com/bolivian-peru/os-moda --skill nix-optimizer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nix-optimizer
Source: https://github.com/bolivian-peru/os-moda/tree/main/skills/nix-optimizer
Command: npx skills add https://github.com/bolivian-peru/os-moda --skill nix-optimizer

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill addresses the common issue of disk space bloat in NixOS by intelligently managing the Nix store, identifying unnecessary files, and optimizing garbage collection.

Core Features & Use Cases

  • Store Analysis: Provides insights into current store size and identifies large, potentially removable items.
  • Intelligent GC: Recommends and performs targeted cleanup, preserving essential generations.
  • Optimization: Includes steps to deduplicate hard links within the Nix store.
  • Use Case: Free up gigabytes of disk space on your NixOS system by safely removing old, unused packages and generations without compromising system stability.

Quick Start

Use the nix-optimizer skill to perform a smart cleanup of the Nix store.

Frequently Asked Questions about nix-optimizer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I reclaim disk space from the Nix store on NixOS?

To reclaim disk space from the Nix store on NixOS, you can analyze disk usage to identify large removable items and perform intelligent garbage collection. This safely removes unused packages while preserving essential generations and system stability.

What is the best way to identify dead entries in the Nix store?

The best way to identify dead entries in the Nix store is by analyzing disk usage to locate large, potentially removable items. This analysis pinpoints unnecessary files contributing to disk space bloat before performing targeted cleanup.

Can I optimize the Nix store without deleting essential system generations?

Yes, you can optimize the Nix store without deleting essential system generations by using intelligent garbage collection. This method performs targeted cleanup while preserving essential generations and can also deduplicate hard links within the store.

Does deduplicating hard links help reduce NixOS disk space usage?

Yes, deduplicating hard links helps reduce NixOS disk space usage by optimizing the Nix store. This process eliminates redundant linked files, reclaiming gigabytes of disk space alongside the removal of old, unused packages.

Do I need shell execution capabilities to perform NixOS garbage collection?

Yes, you need shell execution capabilities to perform NixOS garbage collection. The optimization process requires running Nix commands directly in the shell to analyze the store, identify dead entries, and execute the cleanup operations.