/** The base treefmt configuration that all projects should import from. This will include a consistent configuration for most, if not all, formatters/linters. This will NOT enable the formatters/linters except for a few that are used across all projects (nixfmt, typos etc.). */ { lib, pkgs, ... }: let rumdlConfig = (pkgs.formats.toml { }).generate "rumdl.toml" { global = { cache = false; extend-enable = [ "MD060" ]; }; MD013 = { reflow = true; reflow-mode = "normalize"; }; }; wrappedRumdl = pkgs.symlinkJoin { name = "rumdl-wrapped"; paths = [ pkgs.rumdl ]; nativeBuildInputs = [ pkgs.makeBinaryWrapper ]; postBuild = '' makeBinaryWrapper "${pkgs.rumdl}/bin/rumdl" "$out/bin/rumdl" \ --add-flags "--config ${rumdlConfig}" ''; meta.mainProgram = lib.getName pkgs.rumdl; }; in { projectRootFile = "README.md"; programs = { # keep-sorted start block=yes keep-sorted.enable = true; nixfmt.enable = true; rumdl-check = { enable = true; package = wrappedRumdl; }; typos.enable = true; # keep-sorted end }; }