teepot/packages/fmt/default.nix
Harald Hoyer ee7c4ee177
feat: add fmt nix package
```shell
$ nix run .#fmt
```

does all the automatic formatting the CI checks for.

Signed-off-by: Harald Hoyer <harald@matterlabs.dev>
2024-03-11 12:39:02 +01:00

28 lines
466 B
Nix

# SPDX-License-Identifier: Apache-2.0
# Copyright (c) 2024 Matter Labs
{ lib
, pkgs
, teepot
, ...
}:
pkgs.writeShellApplication {
name = "fmt-teepot";
runtimeInputs = with pkgs;
[ nixpkgs-fmt coreutils taplo ]
++ teepot.teepot.nativeBuildInputs;
text = ''
# .nix
echo "* Formatting nix files"
nixpkgs-fmt .
# .toml
echo "* Formatting toml files"
taplo fmt
# .rs
echo "* Formatting rust files"
cargo fmt
'';
}