3 nixpkgs.url = "flake:nixpkgs";
4 #nixpkgs.url = "github:NixOS/nixpkgs/cdead16a444a3e5de7bc9b0af8e198b11bb01804";
5 pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix";
6 pre-commit-hooks.inputs.nixpkgs.follows = "nixpkgs";
7 symantic-base.url = "git://git.sourcephile.fr/haskell/symantic-base";
8 symantic-base.inputs.nixpkgs.follows = "nixpkgs";
13 lib = inputs.nixpkgs.lib;
14 forAllSystems = f: lib.genAttrs lib.systems.flakeExposed (system: f rec {
16 pkgs = inputs.nixpkgs.legacyPackages.${system};
17 haskellPackages = pkgs.haskellPackages.extend (with pkgs.haskell.lib; hfinal: hsuper: {
18 ${pkg} = doBenchmark (buildFromSdist (hfinal.callCabal2nix pkg ./. { }));
19 symantic-base = buildFromSdist (hfinal.callCabal2nix "symantic-base" inputs.symantic-base { });
20 #url-slug = buildFromSdist (hfinal.callCabal2nix "url-slug" inputs.url-slug { });
21 doctest = dontCheck (doJailbreak (unmarkBroken hsuper.doctest));
22 hspec-contrib = dontCheck (doJailbreak (unmarkBroken hsuper.hspec-contrib));
23 #relude = dontCheck (doJailbreak (unmarkBroken hsuper.relude));
24 scotty = dontCheck (doJailbreak (unmarkBroken hsuper.scotty));
30 defaultPackage = forAllSystems ({ haskellPackages, ... }: haskellPackages.${pkg});
31 # nix -L develop or direnv allow
32 devShell = forAllSystems ({ pkgs, haskellPackages, system, ... }:
33 haskellPackages.shellFor {
34 packages = ps: [ ps.${pkg} ];
36 haskellPackages.cabal-install
38 haskellPackages.haskell-language-server
46 inherit (checks.${system}.pre-commit-check) shellHook;
49 checks = forAllSystems (args: with args; {
50 pre-commit-check = inputs.pre-commit-hooks.lib.${system}.run {
52 #settings.ormolu.cabalDefaultExtensions = true;
53 settings.ormolu.defaultExtensions = [
59 nixpkgs-fmt.enable = true;
60 fourmolu.enable = true;
61 cabal-fmt.enable = true;