back to haskellPackages

This commit is contained in:
nek0 2020-04-17 11:07:50 +02:00
parent 2c39930392
commit ede6d53e05
2 changed files with 43 additions and 12 deletions

View file

@ -1,10 +0,0 @@
{ pkgs ? import <nixpkgs> (import (builtins.fetchTarball https://github.com/input-output-hk/haskell.nix/archive/master.tar.gz))
, haskellCompiler ? "ghc865"
, lib ? pkgs.lib
, config ? pkgs.config
}:
pkgs.haskell-nix.cabalProject {
#src = pkgs.haskell-nix.haskellLib.cleanGit { src = ./.; };
src = pkgs.haskell-nix.haskellLib.cleanGit { src = pkgs.nix-gitignore.gitignoreSource [] ./.; };
ghc = pkgs.buildPackages.pkgs.haskell-nix.compiler.${haskellCompiler};
}

View file

@ -1,4 +1,45 @@
{ nixpkgs ? import <nixpkgs> {}, compiler ? "default", doBenchmark ? false }:
let
hsPkgs = import ./default.nix {};
inherit (nixpkgs) pkgs;
f = { mkDerivation, aeson, base, base16-bytestring
, base64-bytestring, bytestring, containers, http-api-data
, HsYAML, http-types, mtl, network, opaleye, optparse-applicative
, postgresql-simple, product-profunctors, profunctors, pureMD5
, random-bytestring, servant, servant-rawm, servant-server, stdenv
, stm, text, time, wai, wai-logger, warp
}:
mkDerivation {
pname = "mateamt";
version = "0.0.0.0";
src = ./.;
isLibrary = true;
isExecutable = true;
libraryHaskellDepends = [
aeson base base16-bytestring base64-bytestring bytestring
containers http-api-data http-types mtl opaleye postgresql-simple
product-profunctors profunctors pureMD5 random-bytestring servant
servant-rawm servant-server stm text time wai wai-logger warp
];
executableHaskellDepends = [
base base16-bytestring bytestring containers HsYAML mtl network
opaleye optparse-applicative postgresql-simple servant
servant-server stm text time wai wai-logger warp
];
description = "A whole new matemat";
license = stdenv.lib.licenses.agpl3;
};
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
hsPkgs.mateamt.components.all
if pkgs.lib.inNixShell then drv.env else drv