Matthias Andreas Benkard | f1683f5 | 2021-08-24 20:41:41 +0200 | [diff] [blame] | 1 | /* 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" { }); |
Matthias Andreas Benkard | 3994ecf | 2021-08-24 20:42:15 +0200 | [diff] [blame] | 56 | optics-extra = pkgs.haskell.lib.dontCheck |
| 57 | (self.callHackage "optics-extra" "0.4" { }); |
Matthias Andreas Benkard | f1683f5 | 2021-08-24 20:41:41 +0200 | [diff] [blame] | 58 | }; |
| 59 | |
| 60 | modifier = drv: |
| 61 | pkgs.haskell.lib.addBuildTools drv (with pkgs.haskellPackages; |
| 62 | [ |
| 63 | cabal-fmt |
| 64 | cabal-install |
| 65 | ghcid |
| 66 | haskell-language-server |
| 67 | ormolu |
| 68 | ]); |
| 69 | }; |
| 70 | |
| 71 | in |
| 72 | { |
| 73 | defaultPackage = project false; |
| 74 | devShell = project true; |
| 75 | }); |
| 76 | } |