# Nix Justfile

> Conventions for writing justfile recipes in Nix-based projects. Use when this capability is needed.

- Skill: `tomevault-io/nix-justfile` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add tomevault-io/nix-justfile`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tomevault-io/nix-justfile/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: tomevault-io (https://skillmd.com/u/tomevault-io)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tomevault-io/nix-justfile

---


# Justfile in Nix projects

## Doc comments

Every recipe must have a doc comment (`#` line above the recipe name).

## Devshell detection

Use a `nix_shell` variable to auto-detect whether we're inside `nix develop`:

```just
nix_shell := if env('IN_NIX_SHELL', '') != '' { '' } else { 'nix develop -c' }
```

Prefix commands that need devshell tools (node, trunk, cargo-watch, etc.) with `{{nix_shell}}`. Recipes that invoke `nix` directly (build, run, flake commands) don't need it.

## Legibility

Long chained commands should use multiline `\` continuations.

---
> Source: [srid/haskell-flake](https://github.com/srid/haskell-flake) — distributed by [TomeVault](https://tomevault.io).
<!-- tomevault:4.0:skill_md:2026-06-28 -->

