about summary refs log tree commit diff
path: root/treefmt.nix
diff options
context:
space:
mode:
authorFranck Cuny <franck@fcuny.net>2023-12-03 13:14:59 -0800
committerFranck Cuny <franck@fcuny.net>2023-12-03 13:14:59 -0800
commit45f8e2d134e3dd716c5a47d15ab55266cb354ec9 (patch)
treebfb29152a651e6693bce077620b2760e3de38cda /treefmt.nix
parentchore: update flake (#12) (diff)
downloadfcuny.net-45f8e2d134e3dd716c5a47d15ab55266cb354ec9.tar.gz
add `treefmt` and `pre-commit-hooks`
I can now run `nix fmt` or `nix flake check` to check the syntax for
various files in this repository.

Fixed a deprecation warning for `hugo`:
```
> WARN  The author key in site configuration is deprecated. Use params.author.email instead.
> WARN  The author key in site configuration is deprecated. Use params.author.name instead.
```
Diffstat (limited to '')
-rw-r--r--treefmt.nix8
1 files changed, 8 insertions, 0 deletions
diff --git a/treefmt.nix b/treefmt.nix
new file mode 100644
index 0000000..e6164a0
--- /dev/null
+++ b/treefmt.nix
@@ -0,0 +1,8 @@
+{
+  projectRootFile = "flake.nix";
+  programs = {
+    nixfmt.enable = true; # nix
+    taplo.enable = true; # toml
+    yamlfmt.enable = true; # yaml
+  };
+}