on release/0.1.1.0 help sign in
obelisk/release.nix
88 lines 2.5 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 androidSkeleton = (import ./skeleton { obelisk = local-self; }).android.frontend;
65 iosObelisk = import ./. (self-args // {
66 system = "x86_64-darwin";
67 iosSdkVersion = "10.2";
68 });
69 iosSkeleton = (import ./skeleton { obelisk = iosObelisk; }).ios.frontend;
70 in {
71 inherit
72 command
73 ghc ghcjs
74 serverExeSkeleton
75 iosSkeleton
76 androidSkeleton;
77 cache = reflex-platform.pinBuildInputs
78 "obelisk-${system}"
79 cachePackages
80 [command serverExeSkeleton iosSkeleton androidSkeleton];
81 });
83 metaCache = local-self.pinBuildInputs
84 "obelisk-everywhere"
85 (map (a: a.cache) (builtins.attrValues perPlatform))
86 [];
88in perPlatform // { inherit metaCache; }