From 44ca04b9447b9237f8e9edeb36723d6c12075ec1 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Wed, 14 May 2025 17:41:50 -0400 Subject: [PATCH] doc/rl-next: nix-formatter --- doc/manual/rl-next/nix-formatter.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 doc/manual/rl-next/nix-formatter.md diff --git a/doc/manual/rl-next/nix-formatter.md b/doc/manual/rl-next/nix-formatter.md new file mode 100644 index 000000000..56bdd7c19 --- /dev/null +++ b/doc/manual/rl-next/nix-formatter.md @@ -0,0 +1,16 @@ +--- +synopsis: "Add `nix formatter build` and `nix formatter run` commands" +issues: +prs: [13063] +--- + +`nix formatter run` is an alias for `nix fmt`. Nothing new there. + +`nix formatter build` is sort of like `nix build`: it builds, links, and prints a path to the formatter program: + +``` +$ nix formatter build +/nix/store/cb9w44vkhk2x4adfxwgdkkf5gjmm856j-treefmt/bin/treefmt +``` + +Note that unlike `nix build`, this prints the full path to the program, not just the store path (in the example above that would be `/nix/store/cb9w44vkhk2x4adfxwgdkkf5gjmm856j-treefmt`).