@@ -3,66 +3,42 @@
33# - https://github.com/NixOS/nixpkgs/pull/68398
44
55let
6+ inherit (import ./dimension.nix) dimension;
67 nixpkgsVersions = {
78# "release-18.09" = builtins.fetchTarball "https://github.com/input-output-hk/nixpkgs/archive/7e4dcacbf066a8e2d12693a9de1fb30c77081c5d.tar.gz";
89 "release-19.03" = builtins.fetchTarball "https://github.com/input-output-hk/nixpkgs/archive/a8f81dc037a5977414a356dd068f2621b3c89b60.tar.gz";
910 # "release-19.09" = builtins.fetchTarball "https://github.com/input-output-hk/nixpkgs/archive/3d623a406cec9052ae0a16a79ce3ce9de11236bb.tar.gz";
1011 };
12+ systems = {
13+ "x86_64-linux" = {};
14+ };
15+ crossSystems = {
16+ "x86_64-pc-mingw32" = {};
17+ };
1118 haskellNixArgs = import ./.;
12− defaultNixpkgs = import (nixpkgsVersions."release-19.03") {};
13− recRecurseIntoAttrs = with defaultNixpkgs; pred: x: if pred x then recurseIntoAttrs (lib.mapAttrs (n: v: if n == "buildPackages" then v else recRecurseIntoAttrs pred v) x) else x;
1419in
15− recRecurseIntoAttrs (x: with defaultNixpkgs; lib.isAttrs x && !lib.isDerivation x) (
16− builtins.mapAttrs (nixpkgsName: nixpkgsSrc: with (import nixpkgsSrc {}); {
17− x86_64-linux = {
18− hello = with (import nixpkgsSrc (haskellNixArgs // { system = "x86_64-linux"; }));
19− (haskell-nix.hackage-package { name = "hello"; version = "1.0.0.2";}).components.exes.hello;
20− x86_64-pc-mingw32-hello = with (import nixpkgsSrc (haskellNixArgs // { system = "x86_64-linux"; crossSystem.config = "x86_64-pc-mingw32"; }));
21− (haskell-nix.hackage-package { name = "hello"; version = "1.0.0.2";}).components.exes.hello;
22−
23− iserv-proxy = with (import nixpkgsSrc (haskellNixArgs // { system = "x86_64-linux"; }));
24− (ghc-extra-packages.ghc865.iserv-proxy.components.exes).iserv-proxy;
25−
26− x86_64-pc-mingw32-iserv-proxy = with (import nixpkgsSrc (haskellNixArgs // { system = "x86_64-linux"; crossSystem.config = "x86_64-pc-mingw32"; }));
27− (buildPackages.ghc-extra-packages.ghc865.iserv-proxy.components.exes).iserv-proxy;
28−
29− x86_64-pc-mingw32-remote-iserv = with (import nixpkgsSrc (haskellNixArgs // { system = "x86_64-linux"; crossSystem.config = "x86_64-pc-mingw32"; }));
30− (ghc-extra-packages.ghc865.remote-iserv.components.exes).remote-iserv;
31−
32− };
33− x86_64-darwin = {
34− hello = with (import nixpkgsSrc (haskellNixArgs // { system = "x86_64-darwin"; }));
35− (haskell-nix.hackage-package { name = "hello"; version = "1.0.0.2";}).components.exes.hello;
36− x86_64-pc-mingw32-hello = with (import nixpkgsSrc (haskellNixArgs // { system = "x86_64-darwin"; crossSystem.config = "x86_64-pc-mingw32"; }));
37− (haskell-nix.hackage-package { name = "hello"; version = "1.0.0.2";}).components.exes.hello;
38−
39− iserv-proxy = with (import nixpkgsSrc (haskellNixArgs // { system = "x86_64-darwin"; }));
40− (ghc-extra-packages.ghc865.iserv-proxy.components.exes).iserv-proxy;
41−
42− x86_64-pc-mingw32-iserv-proxy = with (import nixpkgsSrc (haskellNixArgs // { system = "x86_64-darwin"; crossSystem.config = "x86_64-pc-mingw32"; }));
43− (buildPackages.ghc-extra-packages.ghc865.iserv-proxy.components.exes).iserv-proxy;
44−
45− x86_64-pc-mingw32-remote-iserv = with (import nixpkgsSrc (haskellNixArgs // { system = "x86_64-darwin"; crossSystem.config = "x86_64-pc-mingw32"; }));
46− (ghc-extra-packages.ghc865.remote-iserv.components.exes).remote-iserv;
47−
48− };
49− haskell-nix.compiler = {
50− x86_64-linux = with (import nixpkgsSrc (haskellNixArgs // { system = "x86_64-linux"; }));
51− haskell-nix.compiler;
52− x86_64-darwin = with (import nixpkgsSrc (haskellNixArgs // { system = "x86_64-darwin";}));
53− haskell-nix.compiler;
54− };
55− tests = {
56− x86_64-linux = (import ./test { nixpkgs = nixpkgsSrc; nixpkgsArgs = { system = "x86_64-linux"; }; });
57− # x86_64-darwin = (import ./test { nixpkgs = nixpkgsSrc; nixpkgsArgs = { system = "x86_64-darwin"; }; });
58− };
59−
60−# Don't build (all of) stackage on linux for now.
61−# stackage = {
62−# x86_64-linux = (with (import nixpkgsSrc (haskellNixArgs // { system = "x86_64-linux"; }));
63−# haskell-nix.snapshots."lts-13.29");
64−# # x86_64-darwin = (with (import nixpkgsSrc (haskellNixArgs // { system = "x86_64-darwin"; }));
65−# # haskell-nix.snapshots."lts-13.29");
66−# };
67−
68−}) nixpkgsVersions)
20+dimension "Nixpkgs version" nixpkgsVersions (nixpkgsName: nixpkgsSrc:
21+ dimension "System" systems (system: _:
22+ # Native builds
23+ # TODO: can we merge this into the general case by picking an appropriate "cross system" to mean native?
24+ let pkgs = import nixpkgsSrc (haskellNixArgs // { inherit system; });
25+ in pkgs.recurseIntoAttrs {
26+ hello = (pkgs.haskell-nix.hackage-package { name = "hello"; version = "1.0.0.2";}).components.exes.hello;
27+ iserv-proxy = pkgs.ghc-extra-packages.ghc865.iserv-proxy.components.exes.iserv-proxy;
28+ ghc = pkgs.recurseIntoAttrs pkgs.haskell-nix.compiler;
29+ tests = pkgs.lib.optionalAttrs (system == "x86_64-linux") (import ./test { inherit pkgs; });
30+ }
31+ //
32+ dimension "Cross system" crossSystems (crossSystem: _:
33+ # Cross builds
34+ let pkgs = import nixpkgsSrc (haskellNixArgs // { inherit system; crossSystem.config = crossSystem; });
35+ in pkgs.recurseIntoAttrs {
36+ hello = (pkgs.haskell-nix.hackage-package { name = "hello"; version = "1.0.0.2";}).components.exes.hello;
37+
38+ iserv-proxy = pkgs.ghc-extra-packages.ghc865.iserv-proxy.components.exes.iserv-proxy;
39+
40+ remote-iserv = pkgs.ghc-extra-packages.ghc865.remote-iserv.components.exes.remote-iserv;
41+ }
42+ )
43+ )
44+)