You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: diff preview, structured renderers, dag template, test coverage (#2)
* feat: add diff preview and json/toml/yaml renderers
Diff app (nix run .#diff-files) shows what the writer would change
without writing. Supports --verbose for full diffs via difftastic.
Structured data options on files.file: json, toml, yaml serialize Nix
values directly — no pkgs.writers.* boilerplate needed.
* feat: add dag demo template for composing files across modules
Shows how multiple flake-parts modules can each contribute sections
to a README with ordering constraints (entryBefore, entryAfter,
entryBetween), then wire the dag-rendered output into files.file.
* style: fix deadnix and statix warnings, format all files
- Remove unused psArgs binding (deadnix)
- Use inherit instead of assignment (statix W04)
- Group repeated keys into attrsets (statix W20)
- Fix dag template URL to denful/dag
- Format all files with treefmt
* fix: enforce mutual exclusivity for text/json/toml/yaml, fix diff /dev/null
* chore: add .worktrees to gitignore
* fix: enable-false test must run writer before checking
* fix: use shellcheck-safe pattern for negated test
`files.treefmt.enable` formats all entries through `nix fmt`
68
72
-**Formatters** — global `files.formatters` by extension and per-file
@@ -82,6 +86,7 @@ Working examples live in [`templates/`](templates/):
82
86
-[`flake-parts`](templates/flake-parts/) — flake-parts + import-tree with treefmt, global formatters, per-file overrides, onChange hooks, and both APIs
83
87
-[`bare-flake`](templates/bare-flake/) — vanilla flake using `evalModules`, no flake-parts dependency
84
88
-[`no-flake`](templates/no-flake/) — pure `default.nix` with `import`, no flake infrastructure
89
+
-[`dag`](templates/dag/) — composing a single file from sections across multiple modules using [dag](https://github.com/theutz/dag) for topological ordering
85
90
86
91
## Quick start
87
92
@@ -116,8 +121,10 @@ Working examples live in [`templates/`](templates/):
116
121
```
117
122
118
123
```sh
119
-
nix run .#write-files # write files to disk
120
-
nix flake check # verify they match
124
+
nix run .#write-files # write files to disk
125
+
nix run .#diff-files # preview what would change
126
+
nix run .#diff-files -- -v # preview with full diffs
127
+
nix flake check # verify they match
121
128
```
122
129
123
130
## With treefmt
@@ -217,6 +224,9 @@ the project root. Use slashes for subdirectories.
0 commit comments