Add treefmt check (#36)

Also add garnix checks.
This commit is contained in:
Sridhar Ratnakumar 2022-08-17 14:23:47 -04:00 committed by GitHub
parent 09928163e0
commit 134332ccf5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 32 additions and 9 deletions

18
flake.lock generated
View file

@ -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"
}
}
},

View file

@ -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;
};
};
};

View file

@ -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: []