/cc-skills-nix:nix-project-scaffoldfrom cc-skills-nix
House-style scaffold for new Nix-flake projects (Go, Python, or other languages) — numtide/blueprint with prefix="nix", direnv .envrc, numtide devshell with in-repo toolchain caches, treefmt formatter, two-file package (default.nix shim + nixpkgs-style package.nix with src=flake), justfile facade, and GitHub Actions CI pinned to flake.lock's nixpkgs. Apply when creating a new project or repository that should use Nix; when adding Nix/flake tooling to an existing Go or Python repo; when asked for a devshell + formatter + CI setup 'like my other repos'; when wiring justfile targets to nix commands; when setting up direnv for a flake. Do NOT use for repos that already follow a different flake convention (flake-parts, devenv, hand-rolled outputs), for NixOS system configuration repos, or for nixpkgs contributions.
Ships in cc-skills-nix. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Reference implementations: aldoborrero/cfleet (Go) and aldoborrero/reolink-exporter (Python). Their tooling files are intentionally identical except for the language-specific blocks — keep new projects identical too, don't improvise. All file contents in references/templates.md; CI and justfile in references/ci-and-justfile.md.
→ Directory semantics and failure modes of blueprint: see the nix-blueprint skill. → formatter.nix details: see the nix-treefmt-formatter skill.
flake.nix # 4 fixed inputs, 5-line outputs (below)
flake.lock
.envrc # use flake + source_env_if_exists .envrc.local
.gitignore # result*, .direnv/, .envrc.local, language caches
justfile # facade: every dev command, delegating to nix/uv/go
nix/
devshell.nix # numtide devshell: just + formatter + toolchain
formatter.nix # treefmt wrapper + hermetic format-check
packages/<name>/
default.nix # { flake, pkgs, ... }: pkgs.callPackage ./package.nix { src = flake; }
package.nix # nixpkgs-style derivation, upstreamable
src/ | cmd/ + internal/ # the actual code, language-idiomatic
{
description = "<one line, reused as the package meta.description>";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs?ref=nixos-unstable";
blueprint.url = "github:numtide/blueprint";
blueprint.inputs.nixpkgs.follows = "nixpkgs";
treefmt-nix.url = "github:numtide/treefmt-nix";
treefmt-nix.inputs.nixpkgs.follows = "nixpkgs";
devshell.url = "github:numtide/devshell";
devshell.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = inputs: inputs.blueprint {
inherit inputs;
prefix = "nix";
};
}
Every non-nixpkgs input gets inputs.nixpkgs.follows = "nixpkgs" — one nixpkgs in the closure. New outputs are never added here; they are files under nix/ (blueprint discovers them).
git init first — flake evaluation in a git repo only sees tracked files.git add -A before any nix command.nix flake lock, then nix flake show to confirm every expected output exists.nix fmt and re-add — the formatter check will fail CI on an unformatted tree.nix develop (or direnv allow) to smoke-test the shell; nix build .#<name> for the package.$HOME: GOPATH=$PRJ_ROOT/.go, UV_PROJECT_ENVIRONMENT=$PRJ_ROOT/.venv — set as devshell env entries, matching .gitignore.NIX_PATH = "nixpkgs=${toString pkgs.path}" in the devshell, so nix-shell -p and legacy tools resolve the same nixpkgs the flake pins.just and perSystem.self.formatter; language toolchain and domain tools each get a comment stating why they're there.default.nix bridges blueprint's scope; package.nix never mentions flake/perSystem and would drop into nixpkgs unchanged. meta is complete: description, homepage, license, sourceProvenance, maintainers, mainProgram, platforms.nativeCheckInputs + pytest hook, or buildGoModule's default go test), so nix flake check is the single CI gate — no separate test job.nix/uv/go; default: lists recipes. Long nix commands get --log-format bar-with-logs locally and --print-build-logs in CI.cachix/install-nix-action pinned by commit SHA and derives nix_path from flake.lock (jq -r '.nodes.nixpkgs.locked.rev') — CI uses exactly the pinned nixpkgs, no channels.AGENTS.md with CLAUDE.md as a symlink to it (layout table, commands table, invariants in prose).What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub aldoborrero/skills --plugin cc-skills-nix6 skills in this plugin
/nix-blueprintnumtide/blueprint — Nix flake framework that maps a fixed directory structure to flake outputs with zero glue code. Apply when a repo's flake.nix calls `inputs.blueprint { ... }`; when deciding where a package, devshell, host, module, check or template file must live; when a package/devshell/host is missing from `nix flake show` or `nix build` says the attribute doesn't exist; when adding the `prefix` option; when writing packages/<name>/default.nix, devshell.nix or modules/<class>/<name>.nix. Do NOT use for generic Nix flakes without blueprint (hand-written outputs, flake-parts, flake-utils), for nixpkgs contributions, or for NixOS module semantics unrelated to file placement. Prefer nix-project-scaffold for creating a NEW project, nix-treefmt-formatter for formatter.nix internals, and nixos-host-provisioning for adding hosts with disko/facter./nix-oci-imageBuilding and publishing OCI/Docker container images from Nix — dockerTools.buildLayeredImage over a buildEnv (app + cacert), non-root numeric User for Kubernetes runAsNonRoot, version-derived tags, and pushing with skopeo (docker-archive → OCI) to registries like Zot that reject `docker push`. Apply when adding a container image output to a flake; when writing packages/docker/*.nix or dockerTools code; when a Nix-built image fails TLS (missing CA bundle), lacks PATH, or runs as root; when pushing ./result to a private/homelab registry fails; when wiring an image build+push recipe into a justfile or CI. Do NOT use for Dockerfile-based builds, docker-compose, or Kubernetes manifest authoring.Other plugins' skills for the same job