Nix-integrated project templates (flake init -t)
  • Nix 82.2%
  • Rust 9.4%
  • Astro 2.3%
  • Emacs Lisp 2%
  • CMake 1.8%
  • Other 2.3%
Find a file
2026-08-12 23:09:19 +07:00
astro chore: ignore .astro generated dir, drop from index 2026-08-12 23:09:19 +07:00
cpp feat: Nix-integrated project templates (astro, rust-tui, rust-app, cpp, elisp, nixlib) 2026-08-12 23:08:39 +07:00
elisp feat: Nix-integrated project templates (astro, rust-tui, rust-app, cpp, elisp, nixlib) 2026-08-12 23:08:39 +07:00
nixlib feat: Nix-integrated project templates (astro, rust-tui, rust-app, cpp, elisp, nixlib) 2026-08-12 23:08:39 +07:00
rust-app feat: Nix-integrated project templates (astro, rust-tui, rust-app, cpp, elisp, nixlib) 2026-08-12 23:08:39 +07:00
rust-tui feat: Nix-integrated project templates (astro, rust-tui, rust-app, cpp, elisp, nixlib) 2026-08-12 23:08:39 +07:00
.gitignore feat: Nix-integrated project templates (astro, rust-tui, rust-app, cpp, elisp, nixlib) 2026-08-12 23:08:39 +07:00
flake.lock feat: Nix-integrated project templates (astro, rust-tui, rust-app, cpp, elisp, nixlib) 2026-08-12 23:08:39 +07:00
flake.nix feat: Nix-integrated project templates (astro, rust-tui, rust-app, cpp, elisp, nixlib) 2026-08-12 23:08:39 +07:00
README.md feat: Nix-integrated project templates (astro, rust-tui, rust-app, cpp, elisp, nixlib) 2026-08-12 23:08:39 +07:00

lunixose templates — Nix-integrated project starting points

Reusable project skeletons, each a self-contained flake with:

  • flake.nix + own flake.lock (works standalone)
  • nix/package.nix (language-appropriate packaging)
  • devShells.default = pkgs.mkShell (matches the rest of the lunixose stack)
  • .forgejo/workflows/ci.yml (generic build+test, no deploy coupling)

Use

# copy a template into the current (empty) dir
nix flake init -t github:quocjq/templates#astro
nix flake init -t git+https://git.lunixose.duckdns.org/lunixose/templates#rust-tui

# or from a local checkout
nix flake init -t /path/to/templates#cpp

# then
nix develop        # dev shell
nix build .        # build the package
nix flake check    # run checks

Templates

name what stack
astro Astro SSR webapp astro + @astrojs/node, buildNpmPackage
rust-tui Rust TUI crane + rust-overlay + ratatui
rust-app Rust application crane + rust-overlay, plain binary
cpp C++ app cmake + clang, stdenv.mkDerivation
elisp Emacs Lisp package trivialBuild
nixlib Minimal Nix lib packages + checks + overlay

Adding the self-deploy chain (optional)

Templates ship a generic CI (build + test) on purpose — a new project should build in isolation, not assume the lunatix deploy infra exists.

When you DO want a project to auto-deploy via the lunatix flake chain (like blog/homepage), add a stage to .forgejo/workflows/ci.yml:

      - name: bump lunatix input
        env:
          HOME: /var/lib/gitea-runner/default
        run: |
          set -euo pipefail
          rm -rf lunatix-ci
          git clone git@github.com:quocjq/lunatix.git lunatix-ci
          cd lunatix-ci
          nix flake update <your-project>
          git config user.name "forgejo-ci"
          git config user.email "ci@lunixose.local"
          git add flake.lock flake.nix
          git diff --cached --quiet && { echo "input already up to date"; exit 0; }
          git commit -m "chore(flake): bump <your-project> input [actions]"
          git push origin main

Then add <your-project> as a flake input in lunatix (modules/community/server/<name>.nix with flake-file.inputs.<name>) — the oracle deploy timer picks the rest up.

Notes

  • npmDepsHash (astro): a magic blob in nix/package.nix. When deps change, run nix build . 2>&1 | grep npmDepsHash and paste the value it prints.
  • Each template has its own lock; nix flake update per project, not globally.
  • CI runs on the oracle runner (host:host, aarch64) — rust/cpp templates are verified on both arches.