git.iko.soy/typeable/cabal2nix
on v1.68 help sign in
typeable/cabal2nix/release.nix
34 lines 1.4 kB history raw
1/* Build instructions for the continuous integration system Hydra. */
3{ cabal2nixSrc ? { outPath = ./.; revCount = 0; gitTag = "dirty"; }
4, releaseBuild ? false
5, supportedPlatforms ? if releaseBuild then ["i686-linux" "x86_64-linux" "x86_64-darwin"] else ["x86_64-linux"]
6, supportedCompilers ? if releaseBuild then ["ghc783"] else ["ghc6104" "ghc6123" "ghc704" "ghc722" "ghc742" "ghc763" "ghc783" "ghcHEAD"]
7}:
9let
10 genAttrs = (import <nixpkgs> { }).lib.genAttrs;
11in
13 cabal2nix = genAttrs supportedCompilers (ghcVer: genAttrs supportedPlatforms (system:
14 let
15 pkgs = import <nixpkgs> { inherit system; };
16 haskellPackages = pkgs.lib.getAttrFromPath ["haskellPackages_${ghcVer}"] pkgs;
17 in
18 haskellPackages.cabal.mkDerivation (self: {
19 pname = "cabal2nix";
20 src = cabal2nixSrc;
21 version = cabal2nixSrc.gitTag;
22 isLibrary = false;
23 isExecutable = true;
24 buildDepends = with haskellPackages; [ Cabal filepath hackageDb HTTP mtl regexPosix ];
25 testDepends = with haskellPackages; [ doctest ];
26 doCheck = self.stdenv.lib.versionOlder "7.6" self.ghc.version;
27 meta = {
28 homepage = "http://github.com/NixOS/cabal2nix";
29 description = "Convert Cabal files into Nix build instructions";
30 license = self.stdenv.lib.licenses.bsd3;
31 maintainers = [ self.stdenv.lib.maintainers.simons ];
32 };
33 })));