Updated Home (markdown)

Jörg Thalheim 2022-05-02 17:56:07 +01:00
parent f26d7e7225
commit f474990e34

21
Home.md

@ -134,4 +134,25 @@ done
"--",
]
includes = ["*.tf"]
```
## Using treefmt in a nix-build
```nix
{ src # src should point to the project to check the format for
, runCommandNoCC
, shfmt
, rustfmt
, treefmt
}:
runCommandNoCC "treefmt" {
# add all your formatters here
nativeBuildInputs = [ shfmt rustfmt treefmt ];
} ''
# keep timestamps so that treefmt is able to detect mtime changes
cp --no-preserve=mode --preserve=timestamps -r ${src} source
cd source
HOME=$TMPDIR treefmt --fail-on-change
touch $out
'';
```