You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

38 lines
1.2 KiB

  1. { nixpkgs ? import <nixpkgs> {}, compiler ? "default", doBenchmark ? false }:
  2. let
  3. inherit (nixpkgs) pkgs;
  4. f = { mkDerivation, aeson, base, bytestring, casing, exceptions
  5. , hspec, hspec-discover, http-conduit, http-types, HUnit, microlens
  6. , microlens-th, mtl, relude, stdenv, text, time, transformers, uuid
  7. }:
  8. mkDerivation {
  9. pname = "hs-square";
  10. version = "0.1.0.0";
  11. src = ./.;
  12. libraryHaskellDepends = [
  13. aeson base bytestring casing exceptions http-conduit http-types
  14. microlens microlens-th mtl relude text time transformers
  15. ];
  16. testHaskellDepends = [
  17. aeson base hspec hspec-discover HUnit microlens relude text time
  18. uuid
  19. ];
  20. testToolDepends = [ hspec-discover ];
  21. license = stdenv.lib.licenses.asl20;
  22. };
  23. haskellPackages = if compiler == "default"
  24. then pkgs.haskellPackages
  25. else pkgs.haskell.packages.${compiler};
  26. variant = if doBenchmark then pkgs.haskell.lib.doBenchmark else pkgs.lib.id;
  27. drv = variant (haskellPackages.callPackage f {});
  28. in
  29. if pkgs.lib.inNixShell then drv.env else drv