numtide / treefmt-nix

treefmt nix configuration
https://numtide.github.io/treefmt/
MIT License
213 stars 62 forks source link

feat(flake-parts): add `pkgs` module option #186

Closed shivaraj-bh closed 1 month ago

srid commented 1 month ago

I believe @shivaraj-bh added this because treefmt-nix requires a newer nixpkgs, so for projects that still use older nixpkgs, we could solve that by explicitly passing a pkgs-latest to treefmt-nix.

cc @roberth (this may be a general thing with all flake-parts modules?)

roberth commented 1 month ago

That's very similar to what I've done in pre-commit, https://flake.parts/options/pre-commit-hooks-nix#opt-perSystem.pre-commit.pkgs

In that one, the pre-commit-hooks modules are loaded into a sub-option settings, which you don't have here, which I think is good, and that's the only real difference.

We could call it a pattern. :+1: