3 nixpkgs.url = "flake:nixpkgs";
4 pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix";
5 pre-commit-hooks.inputs.nixpkgs.follows = "nixpkgs";
10 lib = inputs.nixpkgs.lib;
11 forAllSystems = f: lib.genAttrs lib.systems.flakeExposed (system: f rec {
13 pkgs = inputs.nixpkgs.legacyPackages.${system};
14 haskellPackages = pkgs.haskellPackages.extend (with pkgs.haskell.lib; hfinal: hsuper: {
15 ${pkg} = buildFromSdist (hfinal.callCabal2nix pkg ./. { });
21 defaultPackage = forAllSystems ({ haskellPackages, ... }: haskellPackages.${pkg});
22 # nix -L develop or direnv allow
23 devShell = forAllSystems ({ pkgs, haskellPackages, system, ... }:
24 haskellPackages.shellFor {
25 packages = ps: [ ps.${pkg} ];
27 haskellPackages.cabal-install
29 haskellPackages.haskell-language-server
35 inherit (checks.${system}.pre-commit-check) shellHook;
38 checks = forAllSystems (args: with args; {
39 pre-commit-check = inputs.pre-commit-hooks.lib.${system}.run {
41 #settings.ormolu.cabalDefaultExtensions = true;
42 settings.ormolu.defaultExtensions = [
48 nixpkgs-fmt.enable = true;
49 fourmolu.enable = true;
50 cabal-fmt.enable = true;