diff --git a/flake.nix b/flake.nix index b10172c..2165da3 100644 --- a/flake.nix +++ b/flake.nix @@ -14,6 +14,7 @@ metaler = map (withCategory "metal"); integrator = map (withCategory "integrations"); tooler = map (withCategory "tools"); + formatter = map (withCategory "formatters & linters"); baser = map (withCategory "base"); _file = "github:input-outupt-hk/devshell-capsules"; @@ -147,6 +148,22 @@ ]; }; + # -------------------------------------- + # Tools: common formatting tools + # -------------------------------------- + formatting = {pkgs, ...}: let + nixpkgs' = nixpkgs.${pkgs.system}; + in { + inherit _file; + commands = formatter [ + {package = nixpkgs'.treefmt;} + {package = nixpkgs'.prettier;} + {package = nixpkgs'.shfmt;} + {package = nixpkgs'.alejandra;} + {package = nixpkgs'.statix;} + ]; + }; + # for local use only ... # -------------------------------------- devShell."x86_64-linux" = with nixpkgs."x86_64-linux"; diff --git a/treefmt.toml b/treefmt.toml index dd21baa..13f665d 100644 --- a/treefmt.toml +++ b/treefmt.toml @@ -5,7 +5,7 @@ includes = ["*.nix"] [formatter.prettier] command = "prettier" -options = ["--plugin", "prettier-plugin-toml", "--write"] +options = ["--write"] includes = [ "*.css", "*.html", @@ -17,7 +17,6 @@ includes = [ "*.scss", "*.ts", "*.yaml", - "*.toml", ] [formatter.shell]