git.iko.soy/typeable/cabal2nix
on master help sign in
release.nix: include build instructions for Hydra
commit561d3130838bc2019acbbbfb8736793741f5e882 authorPeter Simons <simons@cryp.to> dateSat 3 May 2014, 11:11 (12 years ago) parent0696498
1 file changed+35
release.nix+35
release.nixnew file+35
@@ -0,0 +1,35 @@
1+/* Build instructions for the continuous integration system Hydra. */
2+
3+{ cabal2nixSrc ? { outPath = ./.; revCount = 0; gitTag = "dirty"; }
4+, supportedPlatforms ? [ "x86_64-linux" ]
5+, supportedCompilers ? ["ghc6123" "ghc704" "ghc722" "ghc742" "ghc763" "ghc782" "ghcHEAD"]
6+}:
7+
8+let
9+ genAttrs = (import <nixpkgs> { }).lib.genAttrs;
10+in
11+{
12+ cabal2nix = genAttrs supportedCompilers (ghcVer: genAttrs supportedPlatforms (system:
13+ let
14+ pkgs = import <nixpkgs> { inherit system; };
15+ haskellPackages = pkgs.lib.getAttrFromPath ["haskellPackages_${ghcVer}"] pkgs;
16+ Cabal = if pkgs.lib.versionOlder haskellPackages.ghcPlain.version "7.6" then haskellPackages.Cabal_1_16_0_3 else null;
17+ hackageDb = haskellPackages.hackageDb.override { inherit Cabal; };
18+ in
19+ haskellPackages.cabal.mkDerivation (self: {
20+ pname = "cabal2nix";
21+ src = cabal2nixSrc;
22+ version = cabal2nixSrc.gitTag;
23+ isLibrary = false;
24+ isExecutable = true;
25+ buildDepends = with haskellPackages; [ Cabal filepath hackageDb HTTP mtl regexPosix ];
26+ testDepends = with haskellPackages; [ doctest ];
27+ doCheck = self.stdenv.lib.versionOlder "7.6" self.ghc.version;
28+ meta = {
29+ homepage = "http://github.com/NixOS/cabal2nix";
30+ description = "Convert Cabal files into Nix build instructions";
31+ license = self.stdenv.lib.licenses.bsd3;
32+ maintainers = [ self.stdenv.lib.maintainers.simons ];
33+ };
34+ })));
35+}