matrix-media-expanded/flake.nix
Sridhar Ratnakumar 134332ccf5
Add treefmt check (#36)
Also add garnix checks.
2022-08-17 14:23:47 -04:00

35 lines
1.1 KiB
Nix

{
description = "srid/haskell-template: Nix template for Haskell projects";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
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, treefmt-flake, ... }:
flake-parts.lib.mkFlake { inherit self; } {
systems = nixpkgs.lib.systems.flakeExposed;
imports = [
haskell-flake.flakeModule
treefmt-flake.flakeModule
];
perSystem = { self', config, pkgs, ... }: {
haskellProjects.default = {
root = ./.;
buildTools = hp: {
inherit (pkgs)
treefmt;
} // config.treefmt.formatters;
};
treefmt.formatters = {
inherit (pkgs)
nixpkgs-fmt;
inherit (pkgs.haskellPackages)
cabal-fmt
fourmolu;
};
};
};
}