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+file:///home/julm/work/sourcephile/haskell/symantic-base";
8 symantic-base.url = "git://git.sourcephile.fr/haskell/symantic-base";
9 symantic-base.inputs.nixpkgs.follows = "nixpkgs";
14 lib = inputs.nixpkgs.lib;
15 forAllSystems = f: lib.genAttrs lib.systems.flakeExposed (system: f rec {
17 pkgs = inputs.nixpkgs.legacyPackages.${system};
18 haskellPackages = pkgs.haskellPackages.extend (with pkgs.haskell.lib; hfinal: hsuper: {
19 ${pkg} = doBenchmark (buildFromSdist (hfinal.callCabal2nix pkg ./. { }));
20 symantic-base = buildFromSdist (hfinal.callCabal2nix "symantic-base" inputs.symantic-base { });
21 #url-slug = buildFromSdist (hfinal.callCabal2nix "url-slug" inputs.url-slug { });
22 #doctest = dontCheck (doJailbreak (unmarkBroken hsuper.doctest));
23 #hspec-contrib = dontCheck (doJailbreak (unmarkBroken hsuper.hspec-contrib));
24 #relude = dontCheck (doJailbreak (unmarkBroken hsuper.relude));
25 #scotty = dontCheck (doJailbreak (unmarkBroken hsuper.scotty));
26 mvc = dontCheck (doJailbreak (unmarkBroken hsuper.mvc));
27 mvc-updates = dontCheck (doJailbreak (unmarkBroken (
28 appendPatch hsuper.mvc-updates ./0001-mvc-updates-fix-L.pretraverseM.patch)));
34 defaultPackage = forAllSystems ({ haskellPackages, ... }: haskellPackages.${pkg});
35 # nix -L develop or direnv allow
36 devShell = forAllSystems ({ pkgs, haskellPackages, system, ... }:
37 haskellPackages.shellFor {
38 packages = ps: [ ps.${pkg} ];
40 haskellPackages.cabal-install
42 haskellPackages.haskell-language-server
50 inherit (checks.${system}.pre-commit-check) shellHook;
53 checks = forAllSystems (args: with args; {
54 pre-commit-check = inputs.pre-commit-hooks.lib.${system}.run {
56 #settings.ormolu.cabalDefaultExtensions = true;
57 settings.ormolu.defaultExtensions = [
63 nixpkgs-fmt.enable = true;
64 fourmolu.enable = true;
65 cabal-fmt.enable = true;