Skip to content

Commit 296d3be

Browse files
committed
docs: add flake-init command documentation
1 parent d3c25b4 commit 296d3be

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

CLAUDE.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ nix develop
2020

2121
# Validate flake
2222
nix flake check
23+
24+
# Scaffold a new project from template
25+
flake-init # uses "minimal" template
26+
flake-init <template> # uses a specific template
2327
```
2428

2529
## Commit Convention
@@ -57,6 +61,8 @@ common/
5761
ghostty/ # Ghostty terminal (macOS only — guarded with mkIf)
5862
lazygit/ # Cross-platform via xdg.configFile
5963
profiles/ # Optional opt-in modules
64+
templates/
65+
minimal/ # Default flake template (devShell, direnv, pre-commit)
6066
systems/
6167
aarch64-darwin/ # macOS: home.nix, homebrew/, defaults.nix, dock.nix
6268
aarch64-linux/default.nix # Linux: minimal HM config for containers

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,28 @@ hmswitch # Apply Home Manager config (Linux)
4444
nix develop # Dev shell with nixfmt, statix, deadnix, nil
4545
nix flake check # Validate configuration
4646
nixswitch --show-trace # Debug build failures
47+
flake-init # Scaffold new project (defaults to minimal template)
48+
flake-init <template> # Scaffold with a specific template
4749
```
4850

51+
### flake-init
52+
53+
Scaffolds a new project directory using Nix flake templates stored in this repo. Uses `nix flake init` under the hood.
54+
55+
```bash
56+
cd ~/Projects/new-thing
57+
flake-init # creates flake.nix, .envrc, .gitignore, .pre-commit-config.yaml
58+
direnv allow # activate the devShell
59+
```
60+
61+
**Available templates:**
62+
63+
| Template | Description |
64+
|----------|-------------|
65+
| `minimal` (default) | devShell with pre-commit, direnv, gitignore |
66+
67+
Templates live in `templates/` and are registered as flake outputs.
68+
4969
## Structure
5070

5171
```

0 commit comments

Comments
 (0)