spreadconfig-nix

Maintains a multi-host NixOS flake repository with Home Manager modules and host-specific scripts.

4|Updated May 20, 2024
One-click install
npx skills add https://github.com/SpreadZhao/spreadconfig --skill spreadconfig-nix-spreadzhao
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: spreadconfig-nix
Source: https://github.com/SpreadZhao/spreadconfig/tree/main/skills/local/spreadconfig-nix
Command: npx skills add https://github.com/SpreadZhao/spreadconfig --skill spreadconfig-nix-spreadzhao

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? Managing a multi-host NixOS flake repository involves repetitive, error-prone tasks: deciding where new modules belong, keeping host-specific settings separate from shared modules, formatting and evaluating Nix code, and recovering from eval or build failures such as fixed-output hash mismatches. This Skill encodes the repository's conventions so every change follows the same validated workflow. ## Core Features & Use Cases - Module and package management: Add user applications as modules/home/<name>.nix files, system services under modules/nixos, and host-only settings under hosts/<host>/, with auto-import conventions respected. - Validation workflow: Run nixfmt, git diff --check, and targeted nix eval commands for the Home Manager activation package or system toplevel of each affected host before applying anything. - Failure handling: Diagnose fixed-output hash mismatches, untracked-file flake path errors, and silent script failures with structured recovery steps. - Script resolution: Use the bundled resolve-nix-script helper to locate the correct sns_until, nix_update, or nix_clean script for the current host, falling back to shared defaults. - Use Case: You want to install a new application on your laptop only. The Skill creates modules/home/drawio.nix, stages the file so Nix can see it, evaluates both hosts' Home Manager packages, and stops short of applying unless you ask. ## Quick Start Use the spreadconfig-nix skill to add a new Home Manager package for my current host and validate the change without switching the system.

Frequently Asked Questions about spreadconfig-nix

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

FAQPage Schema
How do I add a new package to a NixOS Home Manager configuration?

Create a new file like modules/home/<name>.nix containing home.packages = [ pkgs.<pkg> ]; since the default.nix auto-imports regular .nix files. Run git add on the new file so Nix can see it, then evaluate the Home Manager activation package to verify.

How do I rebuild or switch a NixOS flake configuration?

Run ~/scripts/nix/sns_until switch to apply the current configuration live, or sns_until boot for kernel, NVIDIA, or filesystem changes. Use nix_update boot to update flake inputs first and nix_clean boot to remove old generations.

Why does Nix eval fail after adding a new file to a flake?

Git-backed flakes only expose tracked files to Nix, so new files are invisible until staged. Run git add <new-file> before running nix eval or nix build, then retry the evaluation.

How do I fix a fixed-output hash mismatch in a Nix flake?

First determine whether the hash lives in your repository or in an external flake input. If the input is outdated, update it; if upstream is still broken, apply a small local override or pkgs.applyPatches patch rather than vendoring the whole source.

Where should host-specific NixOS settings go in a multi-host flake?

Put host-only NixOS settings under hosts/<host>/nixos and host-only Home Manager settings under hosts/<host>/home. Keep shared behavior in modules/nixos or modules/home, and host-specific config files or scripts under spreadconfig/config/<host> and spreadconfig/scripts/<host>.