@@ -38,21 +38,16 @@ let
38 (name: { inherit name; value = pkgsSet.${name}; })
38 (name: { inherit name; value = pkgsSet.${name}; })
41− concatDepends = let
41+ collect = v:
42− extractDeps = x: (x.override {
42+ if lib.isDerivation v then [v]
43− mkDerivation = drv: {
43+ else if lib.isAttrs v then lib.concatMap collect (builtins.attrValues v)
44− out = builtins.concatLists [
44+ else if lib.isList v then lib.concatMap collect v
45− (drv.buildDepends or [])
45+ else [];
46− (drv.libraryHaskellDepends or [])
47− (drv.executableHaskellDepends or [])
51− in pkgAttrs: builtins.concatLists (map extractDeps (builtins.attrValues pkgAttrs));
53 perPlatform = lib.genAttrs cacheBuildSystems (system: let
47 perPlatform = lib.genAttrs cacheBuildSystems (system: let
54 reflex-platform = import ./dep/reflex-platform { inherit system; };
48 reflex-platform = import ./dep/reflex-platform { inherit system; };
55− perProfiling = profiling: let
50+ mkPerProfiling = profiling: let
56 obelisk = import ./. (self-args // { inherit system profiling; });
51 obelisk = import ./. (self-args // { inherit system profiling; });
57 ghc = pnameToAttrs
52 ghc = pnameToAttrs
58 obelisk.haskellPackageSets.ghc
53 obelisk.haskellPackageSets.ghc
@@ -60,19 +55,6 @@ let
60 ghcjs = pnameToAttrs
55 ghcjs = pnameToAttrs
61 obelisk.haskellPackageSets.ghcjs
56 obelisk.haskellPackageSets.ghcjs
62 obeliskPackagesCommon;
57 obeliskPackagesCommon;
63− cachePackages = builtins.concatLists [
64− (builtins.attrValues ghc)
65− (lib.optionals (!profiling) (builtins.attrValues ghcjs))
67− (lib.optionals (!profiling) (concatDepends ghcjs))
68− (lib.optional reflex-platform.androidSupport androidSkeleton)
69− (lib.optional reflex-platform.iosSupport iosSkeleton)
70− (lib.optionals (!profiling) [
76 command = obelisk.command;
58 command = obelisk.command;
77 skeleton = import ./skeleton { inherit obelisk; };
59 skeleton = import ./skeleton { inherit obelisk; };
78 serverSkeletonExe = skeleton.exe;
60 serverSkeletonExe = skeleton.exe;
@@ -85,29 +67,36 @@ let
85 androidSkeleton = (import ./skeleton { inherit obelisk; }).android.frontend;
67 androidSkeleton = (import ./skeleton { inherit obelisk; }).android.frontend;
86 iosSkeleton = (import ./skeleton { inherit obelisk; }).ios.frontend;
68 iosSkeleton = (import ./skeleton { inherit obelisk; }).ios.frontend;
87 nameSuffix = if profiling then "profiled" else "unprofiled";
69 nameSuffix = if profiling then "profiled" else "unprofiled";
92− cache = reflex-platform.pinBuildInputs "obelisk-${system}-${nameSuffix}" cachePackages;
93− } // lib.optionalAttrs (!profiling) {
76+ } // lib.optionalAttrs (!profiling) {
97− serverSkeletonExe
79+ serverSkeletonExe
100− } // lib.optionalAttrs reflex-platform.androidSupport {
81+ } // lib.optionalAttrs reflex-platform.androidSupport {
101− inherit androidSkeleton;
82+ inherit androidSkeleton;
102− } // lib.optionalAttrs reflex-platform.iosSupport {
83+ } // lib.optionalAttrs reflex-platform.iosSupport {
103− inherit iosSkeleton;
84+ inherit iosSkeleton;
87+ cache = reflex-platform.pinBuildInputs
88+ "obelisk-${system}-${nameSuffix}"
93+ profiled = mkPerProfiling true;
94+ unprofiled = mkPerProfiling false;
105− profiled = perProfiling true;
96+ in perProfiling // {
106− unprofiled = perProfiling false;
107− cachePackages = map (p: p.cache) [ profiled unprofiled ];
109− inherit profiled unprofiled;
110− cache = reflex-platform.pinBuildInputs "obelisk-${system}" cachePackages;
97+ cache = reflex-platform.pinBuildInputs
99+ (map (p: p.cache) (builtins.attrValues perProfiling));
113 metaCache = local-self.reflex-platform.pinBuildInputs
102 metaCache = local-self.reflex-platform.pinBuildInputs