blob: 89ee1f42028ade930c893fac037721e5b7918353 [file] [log] [blame]
Matthias Andreas Benkardf1683f52021-08-24 20:41:41 +02001/* Based on: https://github.com/srid/haskell-template */
2
3{
4 description = "Mulky Backups via Bupstash";
5
6 inputs = {
7 flake-utils.url = "github:numtide/flake-utils";
8 flake-compat = {
9 url = "github:edolstra/flake-compat";
10 flake = false;
11 };
12 };
13
14 outputs = inputs@{ self, nixpkgs, flake-utils, ... }:
15 flake-utils.lib.eachSystem [ "x86_64-linux" "x86_64-darwin" ] (system:
16 let
17 overlays = [ ];
18
19 pkgs =
20 import nixpkgs { inherit system overlays; config.allowBroken = true; };
21
22 co-log-src = pkgs.fetchgit
23 {
24 url = "https://github.com/kowainik/co-log";
25 sha256 = "sha256-XV1xh3aBRY2XwWjGRkd7F2DHf3zTeeFawHJzf05eaWE"; # pkgs.lib.fakeSha256;
26 rev = "72fbe394b437c698d574cd7604ad3f7f807383e0";
27 fetchSubmodules = false;
28 };
29
30 project = returnShellEnv:
31 pkgs.haskellPackages.developPackage {
32 inherit returnShellEnv;
33
34 name = "mulkup";
35
36 root = pkgs.nix-gitignore.gitignoreSource [ ] ./.;
37
38 withHoogle = false;
39
40 overrides = self: super: with pkgs.haskell.lib; {
41 # Use callCabal2nix to override Haskell dependencies here
42 # cf. https://tek.brick.do/K3VXJd8mEKO7
43
44 co-log-polysemy = pkgs.haskell.lib.dontCheck
45 (self.callCabal2nixWithOptions "co-log-polysemy" co-log-src "--subpath=co-log-polysemy" { });
46
47 doctest = pkgs.haskell.lib.dontCheck
48 (self.callHackage "doctest" "0.16.3" { });
49
50 optics = pkgs.haskell.lib.dontCheck
51 (self.callHackage "optics" "0.4" { });
52 optics-core = pkgs.haskell.lib.dontCheck
53 (self.callHackage "optics-core" "0.4" { });
54 optics-th = pkgs.haskell.lib.dontCheck
55 (self.callHackage "optics-th" "0.4" { });
56 optics-extra = pkgs.haskell.lib.dontCheck (
57 self.callHackageDirect
58 {
59 pkg = "optics-extra";
60 ver = "0.4";
61 sha256 = "sha256-oKV8oF0oNHyuActOA7uxBkBzlTgG8LapcKrApa2Pg6U=";
62 }
63 { });
64
65 };
66
67 modifier = drv:
68 pkgs.haskell.lib.addBuildTools drv (with pkgs.haskellPackages;
69 [
70 cabal-fmt
71 cabal-install
72 ghcid
73 haskell-language-server
74 ormolu
75 ]);
76 };
77
78 in
79 {
80 defaultPackage = project false;
81 devShell = project true;
82 });
83}