poetry2nix/dev/treefmt.nix

29 lines
669 B
Nix
Raw Normal View History

2023-10-28 23:40:19 +13:00
{ pkgs, lib, ... }:
{
2023-10-26 12:11:28 +13:00
# Used to find the project root
projectRootFile = "flake.lock";
2023-10-28 23:40:19 +13:00
settings.formatter = {
build-systems = {
command = "sh";
options = [
"-eucx"
''
for i in "$@"; do
${lib.getExe pkgs.jq} --from-file overrides/sort-build-systems.jq --raw-output --sort-keys < "$i" | ${lib.getBin pkgs.moreutils}/bin/sponge "$i"
done
''
"--"
];
includes = [ "overrides/build-systems.json" ];
excludes = [ ];
};
2023-10-30 14:32:21 +13:00
black.excludes = [ "vendor/**.py" ];
2023-10-28 23:40:19 +13:00
};
programs.deadnix.enable = true;
programs.statix.enable = true;
programs.black.enable = true;
2023-10-26 12:11:28 +13:00
}