{ inputs, ... }:
{
  imports = [ inputs.treefmt-nix.flakeModule ];
  perSystem =
    { ... }:
    {
      treefmt = {
        projectRootFile = "flake.nix";
        programs = {
          nixfmt.enable = true;
          prettier.enable = true;
          yamlfmt.enable = true;
          shfmt.enable = true;
        };
        settings = {
          on-unmatched = "fatal";
          global.excludes = [
            "sops/*"
            "vars/*"
            "*/sops/*"
            "*/vars/*"

            "*/.gitignore"
            "LICENSE"

            "inventory.json"
            "*.tfvars.sops.json"
            "*nixos-vars.json"
            "secrets.yaml"
            "facter.json"
            "secrets.auto.tfvars.sops.json"
          ];
        };
      };
    };
}
