2018-03-29 00:12:57 +02:00
|
|
|
{ nixpkgs ? import <nixpkgs> {}, compiler ? "default", doBenchmark ? false }:
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
inherit (nixpkgs) pkgs;
|
|
|
|
|
|
|
|
f = { mkDerivation, ansi-wl-pprint, base, containers, criterion
|
|
|
|
, data-fix, deepseq, deriving-compat, directory, filepath, Glob
|
|
|
|
, parsers, regex-tdfa, regex-tdfa-text, semigroups, split, stdenv
|
|
|
|
, tasty, tasty-hunit, tasty-th, text, transformers, trifecta
|
2018-03-29 08:51:55 +02:00
|
|
|
, unordered-containers, these, optparse-applicative, interpolate
|
2018-04-02 07:49:12 +02:00
|
|
|
, process, exceptions, bytestring, mtl, monadlist, base16-bytestring
|
2018-04-03 23:21:33 +02:00
|
|
|
, cryptohash, template-haskell, syb
|
2018-03-29 00:12:57 +02:00
|
|
|
}:
|
|
|
|
mkDerivation {
|
|
|
|
pname = "hnix";
|
|
|
|
version = "0.4.0";
|
|
|
|
src = ./.;
|
|
|
|
isLibrary = true;
|
|
|
|
isExecutable = true;
|
|
|
|
libraryHaskellDepends = [
|
|
|
|
ansi-wl-pprint base containers data-fix deepseq deriving-compat
|
|
|
|
parsers regex-tdfa regex-tdfa-text semigroups text transformers
|
2018-03-30 10:50:19 +02:00
|
|
|
trifecta unordered-containers these process directory filepath
|
2018-04-02 07:49:12 +02:00
|
|
|
exceptions bytestring mtl monadlist base16-bytestring cryptohash
|
2018-04-03 23:21:33 +02:00
|
|
|
template-haskell syb
|
2018-03-29 00:12:57 +02:00
|
|
|
];
|
|
|
|
executableHaskellDepends = [
|
|
|
|
ansi-wl-pprint base containers data-fix deepseq optparse-applicative
|
2018-04-03 23:21:33 +02:00
|
|
|
text transformers template-haskell
|
2018-03-29 00:12:57 +02:00
|
|
|
];
|
|
|
|
testHaskellDepends = [
|
|
|
|
base containers data-fix directory filepath Glob split tasty
|
2018-03-29 08:51:55 +02:00
|
|
|
tasty-hunit tasty-th text transformers interpolate
|
2018-03-29 00:12:57 +02:00
|
|
|
];
|
|
|
|
benchmarkHaskellDepends = [ base containers criterion text ];
|
|
|
|
homepage = "http://github.com/jwiegley/hnix";
|
|
|
|
description = "Haskell implementation of the Nix language";
|
|
|
|
license = stdenv.lib.licenses.bsd3;
|
|
|
|
};
|
|
|
|
|
|
|
|
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
|