I handle polyglot monorepos using Nix.<p>Because Nix is a package manager not tied to one programming language ecosystem, I can install all the tools for every language I need, and have the tooling consistent and modular, even between monorepos.<p>For formatting I usee treefmt-nix, which quickly format all syntaxes in my repo (.nix, .rs, .md, etc.) by calling individual formatters (installed via Nix), such as rustfmt, mdformat, nixfmt, etc.<p>For git hooks I use lefthook-nix, which automatically installs my git hooks using lefthook. husky, cargo-husky, etc. are great, but they assume you're mainly using one tech stack. lefthook is like pre-commit, but with significantly better dependency chain. (I tried one time to bust the Nix cache and had to download and compile both the .NET runtime <i>and</i> the Swift runtime... it reminded me my dependency footprint could be smaller.)<p>For Cargo workspaces in Rust I use workspace-level linter rules, so all new crates can inherit the same rules.<p>As the author, I also love `just` and I have the CI steps as `just fmt`, etc.<p>This means the same commands I type work in CI, so there's not a parallel environment I have to maintain.<p>I have a `just ci` for running all the steps at once locally, but in GitHub/Forgejo Actions, I like to split them into separate Actions steps for better rendering on web. But `just ci: fmt lint ...` is just an alias, so very little repetition here.<p>Here's a lefthook-nix + treefmt-nix guide: <a href="https://simonshine.dk/articles/lefthook-treefmt-direnv-nix/" rel="nofollow">https://simonshine.dk/articles/lefthook-treefmt-direnv-nix/</a><p>Here's a GitHub Actions + Nix guide: <a href="https://simonshine.dk/articles/speeding-up-ci-with-nix/" rel="nofollow">https://simonshine.dk/articles/speeding-up-ci-with-nix/</a><p>Here's an example project that uses it: <a href="https://github.com/sshine/walltime-rs" rel="nofollow">https://github.com/sshine/walltime-rs</a><p>Here's a "how much Nix should I swallow at once?" guide: <a href="https://simonshine.dk/articles/three-levels-of-nix/" rel="nofollow">https://simonshine.dk/articles/three-levels-of-nix/</a><p>Here's a Forgejo Actions runner that builds and pushes an OCI image to a registry without Docker: <a href="https://git.shine.town/infra/runners/src/branch/main/.forgejo/workflows/build-runners.yaml" rel="nofollow">https://git.shine.town/infra/runners/src/branch/main/.forgej...</a>