summaryrefslogtreecommitdiff
path: root/default.nix
blob: 566e710df032ff5f826c9613567672618accd8b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
{ nixpkgs ? import <nixpkgs> {}, compiler ? "default", doBenchmark ? false }:

let

  inherit (nixpkgs) pkgs;

  f = { mkDerivation, aeson, aeson-pretty, async, base, base-compat
      , base64-bytestring, bytestring, containers, cryptohash-sha1
      , deepseq, directory, dotgen, either, extra, filepath, fmt
      , getopt-generics, hpack, http-client, http-types, lib, lucid
      , microlens-platform, monad-logger, network-uri, process
      , regex-tdfa, servant, servant-client, servant-lucid
      , servant-server, servant-websockets, stm, template-haskell, text
      , text-metrics, time, tomland, transformers, universum, uri-encode
      , uuid, vector, wai, wai-extra, warp, websockets
      }:
      mkDerivation {
        pname = "walint";
        version = "0.1";
        src = ./.;
        isLibrary = true;
        isExecutable = true;
        libraryHaskellDepends = [
          aeson base bytestring containers deepseq dotgen either extra
          filepath getopt-generics network-uri regex-tdfa text text-metrics
          transformers universum uri-encode vector
        ];
        libraryToolDepends = [ hpack ];
        executableHaskellDepends = [
          aeson aeson-pretty async base base-compat base64-bytestring
          bytestring containers cryptohash-sha1 directory extra filepath fmt
          getopt-generics http-client http-types lucid microlens-platform
          monad-logger process servant servant-client servant-lucid
          servant-server servant-websockets stm template-haskell text time
          tomland universum uuid wai wai-extra warp websockets
        ];
        doHaddock = false;
        prePatch = "hpack";
        homepage = "https://stuebinm.eu/git/walint";
        license = "unknown";
        hydraPlatforms = lib.platforms.none;
      };

  haskellPackages = if compiler == "default"
                       then pkgs.haskellPackages
                       else pkgs.haskell.packages.${compiler};

  variant = if doBenchmark then pkgs.haskell.lib.doBenchmark else pkgs.lib.id;

  drv = variant (haskellPackages.callPackage f {});

in
  drv