numtide / treefmt-nix

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

flake-modules.nix: allow empty specification #204

Closed ShamrockLee closed 1 month ago

ShamrockLee commented 1 month ago

Specify the default value of perSystem option treefmt as { } (an empty set) in the flake module.

Fix the "option treefmt used but not defined" error when importing the flake module without adding configurations.

The following check using @zarelit's reproducer shows that the errors disappear after applying this change:

nix flake show github:zarelit/repro-treefmt-issue-78 --override-input treefmt-nix github:ShamrockLee/treefmt-nix/fix-flake-module-empty

This pull request closes #78

Cc: @zarelit @zimbatm

zimbatm commented 1 month ago

thanks!