Reusable Nix flake templates. The root flake.nix is the catalog entrypoint.
go: Production-style Go CLI app template (example-go) with Nix, GoReleaser, andprek.nextjs: Full-stack Next.js canary web app template (example-nextjs) with Nix, Drizzle/PostgreSQL, and Playwright.python: Packaged Python CLI app template (example_pkg) withnix develop,uv, andpytest.
Initialize using the default template:
nix flake init -t github:hcbt/nixplatesInitialize using the Python template explicitly:
nix flake init -t github:hcbt/nixplates#pythonInitialize using the Go template explicitly:
nix flake init -t github:hcbt/nixplates#goInitialize using the Next.js template explicitly:
nix flake init -t github:hcbt/nixplates#nextjsFor local development and CI validation from this repository:
nix flake init -t "path:./#python"
nix flake init -t "path:./#go"
nix flake init -t "path:./#nextjs"Nix flake templates are static file copies. nix flake init does not support interactive variables (for example, app name) at initialization time.
For the Python template, rename placeholders manually right after init:
- Update
[project].nameand[project.scripts]inpyproject.toml. - Rename
src/example_pkgto your package module name. - Update imports/tests and your run command accordingly.
- Update commands in template workflows if they reference placeholder names.
For the Go template, rename placeholders manually right after init:
- Update module path in
go.mod. - Rename
cmd/example-goif you want a different binary name. - Update import paths under
internal/and tests. - Update
.goreleaser.release.ymland.goreleaser.publish.ymlplaceholders.
Root CI in this repository validates only the root flake catalog (nix flake check).
Template runtime/build validation lives in each template's own workflows after initialization.
- Add template files under
templates/<name>. - Keep only source files in the template; do not commit
.direnv/or.devenv/. - Ensure template control files (for example,
.gitignore,.python-version) remain trackable. - Register
templates.<name>in the rootflake.nixand updatetemplates.defaultif needed. - Add or update tests so the template can be initialized and validated in CI.