diff --git a/flake.lock b/flake.lock index 4552968..dd01b3c 100644 --- a/flake.lock +++ b/flake.lock @@ -55,7 +55,23 @@ "inputs": { "flake-parts": "flake-parts", "haskell-flake": "haskell-flake", - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs", + "treefmt-flake": "treefmt-flake" + } + }, + "treefmt-flake": { + "locked": { + "lastModified": 1660759207, + "narHash": "sha256-qr2OrIS6jDpUkc91rmaMoZ+m4RWSDQ/odve9/DLtSsY=", + "owner": "srid", + "repo": "treefmt-flake", + "rev": "7b2e2975513a5a4a87f9b87926de3f00722ec67c", + "type": "github" + }, + "original": { + "owner": "srid", + "repo": "treefmt-flake", + "type": "github" } } }, diff --git a/flake.nix b/flake.nix index 0f05e68..b18ec50 100644 --- a/flake.nix +++ b/flake.nix @@ -5,25 +5,30 @@ flake-parts.url = "github:hercules-ci/flake-parts"; flake-parts.inputs.nixpkgs.follows = "nixpkgs"; haskell-flake.url = "github:srid/haskell-flake"; + treefmt-flake.url = "github:srid/treefmt-flake"; }; - outputs = { self, nixpkgs, flake-parts, haskell-flake, ... }: + outputs = { self, nixpkgs, flake-parts, haskell-flake, treefmt-flake, ... }: flake-parts.lib.mkFlake { inherit self; } { systems = nixpkgs.lib.systems.flakeExposed; imports = [ haskell-flake.flakeModule + treefmt-flake.flakeModule ]; - perSystem = { self', pkgs, ... }: { + perSystem = { self', config, pkgs, ... }: { haskellProjects.default = { root = ./.; buildTools = hp: { inherit (pkgs) - treefmt - nixpkgs-fmt; - inherit (hp) - cabal-fmt - fourmolu; - }; + treefmt; + } // config.treefmt.formatters; + }; + treefmt.formatters = { + inherit (pkgs) + nixpkgs-fmt; + inherit (pkgs.haskellPackages) + cabal-fmt + fourmolu; }; }; }; diff --git a/garnix.yaml b/garnix.yaml index 936d2fe..d25f3af 100644 --- a/garnix.yaml +++ b/garnix.yaml @@ -2,6 +2,8 @@ builds: include: - "packages.x86_64-linux.*" - "packages.aarch64-darwin.*" + - "checks.x86_64-linux.*" + - "checks.aarch64-darwin.*" - "devShells.x86_64-linux.default" - "devShells.aarch64-darwin.default" exclude: []