| name | nix-project-scaffold |
| description | 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. |
| user-invocable | true |
| license | MIT |
| compatibility | Designed for Claude Code, Codex or similar harness. Assumes nix with flakes enabled and git. |
| metadata | {"author":"aldoborrero","version":"1.0.0","openclaw":{"emoji":"🏗","homepage":"https://github.com/aldoborrero/cc-skills-nix","requires":{"bins":"[Truncated]"},"install":[]}} |
| allowed-tools | Read Edit Write Glob Grep Bash(nix:*) Bash(git:*) Bash(just:*) Agent |
| paths | ["**/flake.nix","**/justfile","**/.envrc"] |
New Nix project, house style
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.
Layout
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
flake.nix — always these four inputs
{
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).
Order of operations (a scaffold that skips these fails silently)
git init first — flake evaluation in a git repo only sees tracked files.
- Write all files, then
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 ) to smoke-test the shell; for the package.