diff options
| author | seth <[email protected]> | 2024-07-06 04:07:55 -0400 |
|---|---|---|
| committer | seth <[email protected]> | 2024-07-06 04:12:41 -0400 |
| commit | 9a9a498d262a26e2bb8ae5e078022b7996c6263e (patch) | |
| tree | f6f50aeb9c40fc866008ce918d7fa407f250678d /flake.nix | |
| parent | ece1831de7c94357943b7a999acaf99b7fb80fb7 (diff) | |
tree-wide: start using treefmt
Diffstat (limited to 'flake.nix')
| -rw-r--r-- | flake.nix | 19 |
1 files changed, 17 insertions, 2 deletions
@@ -8,10 +8,20 @@ inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + + # this can be removed with `inputs.treefmt-nix.follows = ""` + treefmt-nix = { + url = "github:numtide/treefmt-nix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; outputs = - { nixpkgs, ... }: + { + self, + nixpkgs, + treefmt-nix, + }: let inherit (nixpkgs) lib; systems = [ @@ -23,8 +33,13 @@ forAllSystems = lib.genAttrs systems; nixpkgsFor = forAllSystems (system: nixpkgs.legacyPackages.${system}); + treefmtFor = forAllSystems (system: treefmt-nix.lib.evalModule nixpkgsFor.${system} ./treefmt.nix); in { + checks = forAllSystems (system: { + treefmt = treefmtFor.${system}.config.build.check self; + }); + packages = forAllSystems ( system: let @@ -43,7 +58,7 @@ pkgs' // { default = pkgs'.treefetch; } ); - formatter = forAllSystems (system: nixpkgsFor.${system}.nixfmt-rfc-style); + formatter = forAllSystems (system: treefmtFor.${system}.config.build.wrapper); templates = import ./templates; }; |
