mateamt/shell.nix

38 lines
1.2 KiB
Nix
Raw Normal View History

2019-04-15 20:23:25 +00:00
{ nixpkgs ? import <nixpkgs> {}, compiler ? "default", doBenchmark ? false }:
let
inherit (nixpkgs) pkgs;
2019-04-21 15:27:15 +00:00
f = { mkDerivation, aeson, base, base16-bytestring, bytestring
2019-05-06 21:41:05 +00:00
, containers, http-api-data, mtl, opaleye, postgresql-simple
, product-profunctors, random-bytestring, servant, servant-server
, stdenv, stm, text, time, wai, wai-logger, warp
2019-04-15 20:23:25 +00:00
}:
mkDerivation {
pname = "mateamt";
version = "0.0.0.0";
src = ./.;
isLibrary = false;
isExecutable = true;
executableHaskellDepends = [
2019-05-06 21:41:05 +00:00
aeson base base16-bytestring bytestring containers http-api-data
mtl opaleye postgresql-simple product-profunctors random-bytestring
servant servant-server stm text time wai wai-logger warp
2019-04-15 20:23:25 +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 {});
in
if pkgs.lib.inNixShell then drv.env else drv