on decrease-android-validity help sign in
obelisk/release.nix
91 lines 2.6 kB history raw
1{ self-args ? {}
2, local-self ? import ./. self-args
3}:
5let
6 inherit (local-self.nixpkgs) lib runCommand nix;
8 cacheBuildSystems = [ "x86_64-linux" "x86_64-darwin" ];
10 obeliskPackagesCommon = [
11 "obelisk-frontend"
12 "obelisk-route"
13 "obelisk-executable-config-lookup"
14 ];
16 obeliskPackagesBackend = obeliskPackagesCommon ++ [
17 "obelisk-asset-manifest"
18 "obelisk-asset-serve-snap"
19 "obelisk-backend"
20 "obelisk-cliapp"
21 "obelisk-command"
22 "obelisk-executable-config-inject"
23 "obelisk-frontend"
24 "obelisk-run"
25 "obelisk-route"
26 "obelisk-selftest"
27 "obelisk-snap-extras"
28 ];
30 pnameToAttrs = pkgsSet: pnames:
31 lib.listToAttrs (map
32 (name: { inherit name; value = pkgsSet.${name}; })
33 pnames);
35 concatDepends = let
36 extractDeps = x: (x.override {
37 mkDerivation = drv: {
38 out = builtins.concatLists [
39 (drv.buildDepends or [])
40 (drv.libraryHaskellDepends or [])
41 (drv.executableHaskellDepends or [])
42 ];
43 };
44 }).out;
45 in pkgAttrs: builtins.concatLists (map extractDeps (builtins.attrValues pkgAttrs));
47 perPlatform = lib.genAttrs cacheBuildSystems (system: let
48 obelisk = import ./. { inherit system; };
49 reflex-platform = obelisk.reflex-platform;
50 ghc = pnameToAttrs
51 obelisk.haskellPackageSets.ghc
52 obeliskPackagesBackend;
53 ghcjs = pnameToAttrs
54 obelisk.haskellPackageSets.ghcjs
55 obeliskPackagesCommon;
56 cachePackages = builtins.concatLists [
57 (builtins.attrValues ghc)
58 (builtins.attrValues ghcjs)
59 (concatDepends ghc)
60 (concatDepends ghcjs)
61 ];
62 command = local-self.command;
63 serverExeSkeleton = (import ./skeleton { obelisk = local-self; }).exe;
64 androidObelisk = import ./. (self-args // {
65 config.android_sdk.accept_license = true;
66 });
67 androidSkeleton = (import ./skeleton { obelisk = androidObelisk; }).android.frontend;
68 iosObelisk = import ./. (self-args // {
69 system = "x86_64-darwin";
70 iosSdkVersion = "10.2";
71 });
72 iosSkeleton = (import ./skeleton { obelisk = iosObelisk; }).ios.frontend;
73 in {
74 inherit
75 command
76 ghc ghcjs
77 serverExeSkeleton
78 iosSkeleton
79 androidSkeleton;
80 cache = reflex-platform.pinBuildInputs
81 "obelisk-${system}"
82 cachePackages
83 [command serverExeSkeleton iosSkeleton androidSkeleton];
84 });
86 metaCache = local-self.pinBuildInputs
87 "obelisk-everywhere"
88 (map (a: a.cache) (builtins.attrValues perPlatform))
89 [];
91in perPlatform // { inherit metaCache; }