nix-rust-leptos
Conventions for building Leptos CSR apps with Nix (crane + Trunk).
Skill by juspay
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/juspay-nix-rust-leptos
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/nix-rust-leptos
What's inside
- Skill name
nix-rust-leptos- Description
- Conventions for building Leptos CSR apps with Nix (crane + Trunk).
- License
- MIT
- Instructions
- 64 lines in SKILL.md · view on GitHub
Files (1)
- SKILL.md
SKILL.md (first lines)
# Leptos CSR + Nix Build
## Use Trunk for production builds
Don't manually run wasm-bindgen + wasm-opt + hash-rename. Use `craneLib.buildTrunkPackage` which delegates to Trunk — it handles WASM compilation, wasm-bindgen, wasm-opt, Tailwind CSS, asset hashing, SRI, and cross-reference rewriting automatically.
## Workspace layout
Trunk expects to run from the crate directory containing `index.html` and `Cargo.toml`. In a workspace, use `postUnpack` to cd into the client crate:
```nix
clientDist = craneLib.buildTrunkPackage {
pname = "my-client";
inherit src;
cargoExtraArgs = "-p my-client";
wasm-bindgen-cli = pkgs.wasm-bindgen-cli;
nativeBuildInputs = [ pkgs.tailwindcss ]; # not auto-included
postUnpack = ''
cd $sourceRoot/client
sourceRoot="."
'';
};
```
## Source filtering
Crane's default source filter strips non-Rust files. Preserve HTML, CSS, and JS for Trunk:
```nix
src = lib.fileset.toSource {
root = ./.;
fileset = lib.fileset.unions [
(craneLib.fileset.commonCargoSources ./.)
(lib.fileset.fileFilter (f: lib.any f.hasExt [ "html" "css" "js" ]) ./.)
];
};
```
## Version matching
`wasm-bindgen-cli` in nixpkgs must match `wasm-bindgen` in `Cargo.lock` exactly. Check with `nix eval --raw 'nixpkgs#wasm-bindgen-cli.version'`.
## Tailwind CSS
Use `<link data-trunk rel="tailwind-css" href="input.css" />` in index.html. Trunk processes it automatically. Add `pkgs.tailwindcss` to `nativeBuildInputs` (not auto-included by crane).
## leptos-use for browser APIs
Use the `leptos-use` crate instead of raw `web_sys` for browser APIs. It provides reactive hooks with automatic cleanup on component unmount — no more `Closure::wrap` + `.forget()` memory leaks.
Key hooks:
- `use_resize_observer` — replaces manual `ResizeObserver::new()` + `Closure::wrap` + `forget`
- `use_event_listener` / `use_event_listener_with_options` — replaces manual `add_event_listener` + `Closure::wrap` + `forget`
- `use_websocket` / `use_websocket_with_options` — replaces manual `WebSocket::new()` + callback wiring
- `on_cleanup` — registers component unmount logic (dispose resources, close connections)
Version compatibility: `leptos-use` 0.18.x works with Leptos 0.8.x. Use the `codee` crate for WebSocket codecs (e.g. `codee::string::FromToStringCodec`).
For JS objects that aren't `Send + Sync` (like wasm-bindgen types), wrap in `send_wrapper::SendWrapper` when passing to leptos-use callbacks.
## Module structure for JS interop
Keep non-Leptos JS helpers (raw `web_sys` calls, `wasm_bindgen` utilities, localStorage, animation frames) in a separate `bridge.rs` module. Leptos components should only use Leptos reactive primitives and leptos-use hooks — not raw browser APIs directly.From juspay/skills, MIT.
More from juspay/skills
- 0.632score
solidjs
juspay
Use this when writing, reviewing, or auditing SolidJS code for fine-grained reactivity, stable view identity, and owned resource lifetimes.
SkillAFreshness: A★ 11Claude Code +9 - 0.631score
nix-ci
juspay
Use this when setting up CI for a GitHub repository — offers GitHub Actions or Vira depending on the project
SkillAFreshness: A★ 11Claude Code +9 - 0.628score
nix-for-dev
juspay
Use this when setting up Nix for a development project (devShell + package build) and you care about `nix develop` being fast.
SkillAFreshness: A★ 11Claude Code +9 - 0.626score
waterfall
juspay
Implement anything end-to-end using two agents: planner cum reviewer (premium model) and an implementer (fast model)
SkillAFreshness: A★ 11Claude Code +9 - 0.592score
pg
juspay
Write essays, articles, and blog posts in Paul Graham's voice — plain, spoken prose that reasons out loud and lands surprising true claims, not AI filler.
SkillBFreshness: B★ 11Claude Code +9 - 0.586score
nix-typescript
juspay
pnpm + Nix build conventions.
SkillBFreshness: B★ 11Claude Code +9 - 0.586score
nix-justfile
juspay
Conventions for writing justfile recipes in Nix-based projects.
SkillBFreshness: B★ 11Claude Code +9 - 0.581score
cargo-watch
juspay
Run cargo-watch in the background for continuous clippy feedback during code editing.
SkillBFreshness: B★ 11Claude Code +9 - 0.542score
nix-perf
juspay
Use this when a flake's `nix develop` / `direnv allow` / `nix flake archive` is slow on a fresh checkout (the "first time takes 10 minutes" complaint).
SkillCFreshness: C★ 11Claude Code +9 - 0.542score
nix-bun
juspay
Use this when building a Bun (bun.lock) project with Nix.
SkillCFreshness: C★ 11Claude Code +9 - 0.542score
nix-oss-cache
juspay
Use this when setting up a GitHub repo to push its Nix builds to Juspay's shared OSS Attic cache (cache.nixos.asia/oss) — adds the substituter to flake.nix, a…
SkillCFreshness: C★ 11Claude Code +9 - 0.477score
nix-health
juspay
Use this when diagnosing or fixing a user's Nix installation — checks flakes, version, caches, max-jobs, direnv, rosetta, trusted-users, and shell config
SkillDFreshness: D★ 11Claude Code +9
Signals
- Stars
- 11
- Forks
- 0
- Open issues
- 3
- Last commit (this folder)
- Sep 16, 2026 (1 month ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/juspay/skills
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from juspay
- 0.632score
solidjs
juspay
Use this when writing, reviewing, or auditing SolidJS code for fine-grained reactivity, stable view identity, and owned resource lifetimes.
SkillAFreshness: A★ 11Claude Code +9 - 0.631score
nix-ci
juspay
Use this when setting up CI for a GitHub repository — offers GitHub Actions or Vira depending on the project
SkillAFreshness: A★ 11Claude Code +9 - 0.628score
nix-for-dev
juspay
Use this when setting up Nix for a development project (devShell + package build) and you care about `nix develop` being fast.
SkillAFreshness: A★ 11Claude Code +9 - 0.626score
waterfall
juspay
Implement anything end-to-end using two agents: planner cum reviewer (premium model) and an implementer (fast model)
SkillAFreshness: A★ 11Claude Code +9 - 0.601score
nix-chrome-devtools-mcp
juspay
chrome-devtools-mcp launcher — a single bash script that resolves Playwright's bundled Chrome-for-Testing and Node.js directly through Nix.
SkillAFreshness: A★ 4Claude Code +9 - 0.592score
pg
juspay
Write essays, articles, and blog posts in Paul Graham's voice — plain, spoken prose that reasons out loud and lands surprising true claims, not AI filler.
SkillBFreshness: B★ 11Claude Code +9
Cite this page
nix-rust-leptos skill. Agent Mart. https://agentmart.dev/skills/juspay-nix-rust-leptos (last updated 2026-10-24)