This is a Nix-powered Svelte template with Effect integration. It builds an app fully reproducibly, including tests.
To quickly get started with this template, run:
mkdir project
cd project
nix flake init -t github:cor/svelte-effect-nix-template
git init
To build the app, run:
nix build .#app -L
This will:
vitest./resultTo preview the built app in a browser, run:
nix run .#app-preview
This will:
miniserveThe preview server uses SPA mode, so client-side routing will work correctly.
To start the development server with hot reloading:
nix run .#app-dev
This will install dependencies and start the Svelte development server.
To enter a development shell with all necessary tools:
nix develop
This provides:
Format all code in the project with:
nix fmt
This project uses treefmt to orchestrate multiple formatters and linters through a single command. The configuration is defined in nix/treefmt.nix.
| Tool | File Types |
|---|---|
| Biome | TypeScript, JavaScript, CSS, JSON, JSONC, TSX, JSX, GraphQL, HTML, Svelte, Astro |
| nixfmt-rfc-style | Nix |
| taplo | TOML |
| yamlfmt | YAML |
| mdformat | Markdown |
| Tool | Purpose |
|---|---|
| Biome | JavaScript/TypeScript linting with recommended rules |
| statix | Nix linting |
| deadnix | Detect unused Nix code |
| shellcheck | Shell script analysis |