mateamt/shell.nix

50 lines
1.8 KiB
Nix
Raw Normal View History

2020-04-17 09:07:50 +00:00
{ nixpkgs ? import <nixpkgs> {}, compiler ? "default", doBenchmark ? false }:
2019-04-15 20:23:25 +00:00
let
2020-04-17 09:07:50 +00:00
inherit (nixpkgs) pkgs;
f = { mkDerivation, aeson, base, base16-bytestring
2020-05-10 05:28:17 +00:00
, base64-bytestring, bytestring, case-insensitive, clock
, containers, extra, HsYAML, http-api-data, http-types, iproute
, mtl, network, opaleye, optparse-applicative, postgresql-simple
2020-05-10 05:28:17 +00:00
, postgresql-simple-migration, product-profunctors, profunctors
, pureMD5, random-bytestring, servant, servant-rawm, servant-server
, stdenv, stm, text, time, wai, wai-logger, wai-middleware-throttle
, warp
2020-04-17 09:07:50 +00:00
}:
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 = [
2020-05-10 05:28:17 +00:00
base base16-bytestring bytestring case-insensitive clock containers
extra HsYAML iproute mtl network opaleye optparse-applicative
2020-05-10 05:28:17 +00:00
postgresql-simple postgresql-simple-migration servant
servant-server stm text time wai wai-logger wai-middleware-throttle
warp
2020-04-17 09:07:50 +00:00
];
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 {});
2019-04-15 20:23:25 +00:00
in
2020-04-17 09:07:50 +00:00
if pkgs.lib.inNixShell then drv.env else drv