mirror of
https://github.com/coot/free-category.git
synced 2024-09-11 14:17:30 +03:00
36 lines
841 B
Nix
36 lines
841 B
Nix
{ compiler ? "ghc843"
|
|
, haddock ? true
|
|
, test ? true
|
|
, benchmarks ? false
|
|
, dev ? true
|
|
}:
|
|
with builtins;
|
|
let
|
|
spec = fromJSON (readFile ./nixpkgs.json);
|
|
src = fetchTarball {
|
|
url = "https://github.com/${spec.owner}/${spec.repo}/archive/${spec.rev}.tar.gz";
|
|
sha256 = spec.sha256;
|
|
};
|
|
nixpkgs = import src {};
|
|
|
|
pkgs = nixpkgs.haskell.packages;
|
|
lib = nixpkgs.haskell.lib;
|
|
|
|
doHaddock = if haddock
|
|
then lib.doHaddock
|
|
else lib.dontHaddock;
|
|
doTest = if test
|
|
then lib.doCheck
|
|
else lib.dontCheck;
|
|
doBench = if benchmarks
|
|
then lib.doBenchmark
|
|
else nixpkgs.lib.id;
|
|
doDev = if dev
|
|
then drv: lib.enableCabalFlag drv "develop"
|
|
else nixpkgs.lib.id;
|
|
|
|
free-category = doDev(doHaddock(doTest(doBench(
|
|
pkgs.${compiler}.callPackage ./pkg.nix { inherit nixpkgs; }))));
|
|
in
|
|
{ inherit free-category; }
|