default.nix 936 B

123456789101112131415161718192021222324252627282930313233
  1. { nixpkgs ? import <nixpkgs> {}, compiler ? "default" }:
  2. let
  3. inherit (nixpkgs) pkgs;
  4. f = { mkDerivation, base, containers, freer, mtl, parsec, stdenv
  5. , these, transformers
  6. }:
  7. mkDerivation {
  8. pname = "dtt";
  9. version = "0.1.0.0";
  10. src = ./.;
  11. isLibrary = false;
  12. isExecutable = true;
  13. executableHaskellDepends = [
  14. base containers freer mtl parsec these transformers
  15. ];
  16. homepage = "https://amulet.ml/dtt/";
  17. description = "A dependent type theory for use in proof checking and the implementation of the Amulet programming language";
  18. license = stdenv.lib.licenses.bsd3;
  19. };
  20. haskellPackages = if compiler == "default"
  21. then pkgs.haskellPackages
  22. else pkgs.haskell.packages.${compiler};
  23. drv = haskellPackages.callPackage f {};
  24. in
  25. if pkgs.lib.inNixShell then drv.env else drv