on deploy-init-create-clientSessionKey help sign in
obelisk/release.nix
80 lines 2.1 kB history raw
1{ local-self ? import ./. {}
2}:
4let
5 inherit (local-self.nixpkgs) lib runCommand nix;
7 cacheBuildSystems = [ "x86_64-linux" "x86_64-darwin" ];
9 obeliskPackagesCommon = [
10 "obelisk-frontend"
11 "obelisk-route"
12 "obelisk-executable-config"
13 ];
15 obeliskPackagesBackend = obeliskPackagesCommon ++ [
16 "obelisk-asset-manifest"
17 "obelisk-asset-serve-snap"
18 "obelisk-backend"
19 "obelisk-cliapp"
20 "obelisk-command"
21 "obelisk-executable-config-inject"
22 "obelisk-frontend"
23 "obelisk-run"
24 "obelisk-route"
25 "obelisk-selftest"
26 "obelisk-snap-extras"
27 ];
29 pnameToAttrs = pkgsSet: pnames:
30 lib.listToAttrs (map
31 (name: { inherit name; value = pkgsSet.${name}; })
32 pnames);
34 concatDepends = let
35 extractDeps = x: (x.override {
36 mkDerivation = drv: {
37 out = builtins.concatLists [
38 (drv.buildDepends or [])
39 (drv.libraryHaskellDepends or [])
40 (drv.executableHaskellDepends or [])
41 ];
42 };
43 }).out;
44 in pkgAttrs: builtins.concatLists (map extractDeps (builtins.attrValues pkgAttrs));
46 perPlatform = lib.genAttrs cacheBuildSystems (system: let
47 obelisk = import ./. { inherit system; };
48 reflex-platform = obelisk.reflex-platform;
49 ghc = pnameToAttrs
50 obelisk.haskellPackageSets.ghc
51 obeliskPackagesBackend;
52 ghcjs = pnameToAttrs
53 obelisk.haskellPackageSets.ghcjs
54 obeliskPackagesCommon;
55 cachePackages = builtins.concatLists [
56 (builtins.attrValues ghc)
57 (builtins.attrValues ghcjs)
58 (concatDepends ghc)
59 (concatDepends ghcjs)
60 ];
61 command = local-self.command;
62 serverExeSkeleton = (import ./skeleton {}).exe;
63 builtSkeleton = (import ./skeleton {}).all;
64 in {
65 inherit
66 command
67 ghc ghcjs
68 serverExeSkeleton builtSkeleton;
69 cache = reflex-platform.pinBuildInputs
70 "obelisk-${system}"
71 cachePackages
72 [command serverExeSkeleton builtSkeleton];
73 });
75 metaCache = local-self.pinBuildInputs
76 "obelisk-everywhere"
77 (map (a: a.cache) (builtins.attrValues perPlatform))
78 [];
80in perPlatform // { inherit metaCache; }