@@ -1,45 +1,81 @@
1{ local-self ? import ./. {}
1{ local-self ? import ./. {}
2−, local-pkgs ? local-self.nixpkgs
5−with local-pkgs.lib;
4+let
6−
5+ inherit (local-self.nixpkgs) lib runCommand nix;
7−genAttrs [ "x86_64-linux" "x86_64-darwin" ] (system: {
7+ cacheBuildSystems = [ "x86_64-linux" "x86_64-darwin" ];
9+ obeliskPackagesCommon = [
12+ "obelisk-executable-config"
15+ obeliskPackagesBackend = obeliskPackagesCommon ++ [
16+ "obelisk-asset-manifest"
17+ "obelisk-asset-serve-snap"
21+ "obelisk-executable-config-inject"
27+ "obelisk-snap-extras"
30+ pnameToAttrs = pkgsSet: pnames:
32+ (name: { inherit name; value = pkgsSet.${name}; })
36+ extractDeps = x: (x.override {
37+ mkDerivation = drv: {
38+ out = builtins.concatLists [
39+ (drv.buildDepends or [])
40+ (drv.libraryHaskellDepends or [])
41+ (drv.executableHaskellDepends or [])
45+ in pkgAttrs: builtins.concatLists (map extractDeps (builtins.attrValues pkgAttrs));
47+ perPlatform = lib.genAttrs cacheBuildSystems (system: let
8− inherit (import ./. { inherit system; }) command;
48+ obelisk = import ./. { inherit system; };
9− built-skeleton = (import ./skeleton { inherit system; }).all;
49+ reflex-platform = obelisk.reflex-platform;
10− tests = {
50+ ghc = pnameToAttrs
11− #TODO: Doesn't work; see discussion in https://www.pivotaltracker.com/story/show/157265140
51+ obelisk.haskellPackageSets.ghc
12− # ob-init = runCommand "ob-init" {
52+ obeliskPackagesBackend;
13− # nativeBuildInputs = [
53+ ghcjs = pnameToAttrs
54+ obelisk.haskellPackageSets.ghcjs
55+ obeliskPackagesCommon;
56+ cachePackages = builtins.concatLists [
57+ (builtins.attrValues ghc)
58+ (builtins.attrValues ghcjs)
60+ (concatDepends ghcjs)
62+ command = local-self.command;
63+ serverExeSkeleton = (import ./skeleton {}).exe;
64+ builtSkeleton = (import ./skeleton {}).all;
14− # self.command
67+ command
16− # ];
69+ serverExeSkeleton builtSkeleton;
17− # } ''
70+ cache = reflex-platform.pinBuildInputs
18− # # mkdir $out
71+ "obelisk-${system}"
19− # # cd $out
72+ cachePackages
20− # # ob init --symlink=${self.path}
73+ [command serverExeSkeleton builtSkeleton];
23− #TODO: Re-enable this
76+ metaCache = local-self.pinBuildInputs
24− #verify-migration = runCommand "verify-migration" {
25− # nativeBuildInputs = [
27− # nix # obelisk uses `nix-hash`
31− # # Fix permissions so `removePathForcibly` works on copied-to-tmp paths
32− # cp -a ${self.pathGit} $TMPDIR/obelisk
33− # cd $TMPDIR/obelisk
77+ "obelisk-everywhere"
34− # chmod -R u+w .
78+ (map (a: a.cache) (builtins.attrValues perPlatform))
37− # ob internal hash;
81+in perPlatform // { inherit metaCache; }
38− # ob internal verify-migration;