diff --git a/fmt.nix b/fmt.nix new file mode 100644 index 0000000..6a9888b --- /dev/null +++ b/fmt.nix @@ -0,0 +1,37 @@ +{ 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" + "emu-files/*" + ]; + }; + }; + }; +}