on v0.7.1.0 help sign in
reflex/release.nix
58 lines 1.9 kB history raw
1{ reflex-platform-fun ? import ./dep/reflex-platform
2, supportedSystems ? ["x86_64-linux" "x86_64-darwin"]
3}:
5let
6 native-reflex-platform = reflex-platform-fun {};
7 inherit (native-reflex-platform.nixpkgs) lib;
9 perPlatform = lib.genAttrs supportedSystems (system: let
10 reflex-platform = reflex-platform-fun { inherit system; };
11 compilers = [
12 "ghc"
13 "ghcjs"
14 ] ++ lib.optionals (reflex-platform.androidSupport) [
15 "ghcAndroidAarch64"
16 "ghcAndroidAarch32"
17 ] ++ lib.optionals (reflex-platform.iosSupport) [
18 "ghcIosAarch64"
19 ];
20 variations = map (v: "reflex" + v) [
21 "-dontUseTemplateHaskell"
22 ""
23 ];
24 compilerPkgs = lib.genAttrs compilers (ghc: let
25 variationPkgs = lib.genAttrs variations (variation: let
26 reflex-platform = reflex-platform-fun {
27 inherit system;
28 __useTemplateHaskell = variation == "reflex"; # TODO hack
29 haskellOverlays = [
30 # Use this package's source for reflex
31 (self: super: {
32 _dep = super._dep // {
33 reflex = builtins.filterSource (path: type: !(builtins.elem (baseNameOf path) [
34 "release.nix"
35 ".git"
36 "dist"
37 "cabal.haskell-ci"
38 "cabal.project"
39 ".travis.yml"
40 ])) ./.;
41 };
42 })
43 ];
44 };
45 in reflex-platform.${ghc}.reflex);
46 in variationPkgs // {
47 cache = reflex-platform.pinBuildInputs "reflex-${system}-${ghc}"
48 (builtins.attrValues variationPkgs);
49 });
50 in compilerPkgs // {
51 cache = reflex-platform.pinBuildInputs "reflex-${system}"
52 (map (a: a.cache) (builtins.attrValues compilerPkgs));
53 });
55 metaCache = native-reflex-platform.pinBuildInputs "reflex-everywhere"
56 (map (a: a.cache) (builtins.attrValues perPlatform));
58in perPlatform // { inherit metaCache; }