3 nixpkgs.url = "flake:nixpkgs";
4 pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix";
5 pre-commit-hooks.inputs.nixpkgs.follows = "nixpkgs";
6 #symantic-base.url = "git+https://git.code.sourcephile.fr/~julm/symantic-base?ref=main";
7 symantic-base.url = "git://git.sourcephile.fr/haskell/symantic-base";
8 symantic-base.inputs.nixpkgs.follows = "nixpkgs";
9 url-slug.url = "github:srid/url-slug";
10 url-slug.inputs.nixpkgs.follows = "nixpkgs";
15 lib = inputs.nixpkgs.lib;
16 forAllSystems = f: lib.genAttrs lib.systems.flakeExposed (system: f rec {
18 pkgs = inputs.nixpkgs.legacyPackages.${system};
19 haskellPackages = pkgs.haskellPackages.extend (with pkgs.haskell.lib; hfinal: hsuper: {
20 ${pkg} = buildFromSdist (hfinal.callCabal2nix pkg ./. { });
21 symantic-base = buildFromSdist (hfinal.callCabal2nix "symantic-base" inputs.symantic-base { });
22 url-slug = buildFromSdist (hfinal.callCabal2nix "url-slug" inputs.url-slug { });
28 defaultPackage = forAllSystems ({ haskellPackages, ... }: haskellPackages.${pkg});
29 # nix -L develop or direnv allow
30 devShell = forAllSystems ({ pkgs, haskellPackages, system, ... }:
31 haskellPackages.shellFor {
32 packages = ps: [ ps.${pkg} ];
34 haskellPackages.cabal-install
36 haskellPackages.haskell-language-server
42 inherit (checks.${system}.pre-commit-check) shellHook;
45 checks = forAllSystems (args: with args; {
46 pre-commit-check = inputs.pre-commit-hooks.lib.${system}.run {
48 settings.ormolu.defaultExtensions = [
54 nixpkgs-fmt.enable = true;
55 fourmolu.enable = true;
56 cabal-fmt.enable = true;