on master help sign in
Merge remote-tracking branch 'origin/develop' into qa
41d710bElliot Cameron
README.md−7
@@ -4,7 +4,6 @@ Obelisk provides an easy way to develop and deploy your [Reflex](https://github.
4
4
5- [Installing Obelisk](#installing-obelisk)
5- [Installing Obelisk](#installing-obelisk)
6- [Developing an Obelisk project](#developing-an-obelisk-project)
6- [Developing an Obelisk project](#developing-an-obelisk-project)
7− - [Hoogle](#hoogle)
8 - [Adding Packages](#adding-packages)
7 - [Adding Packages](#adding-packages)
9 - [Adding Package Overrides](#adding-package-overrides)
8 - [Adding Package Overrides](#adding-package-overrides)
10 - [Running over https](#running-over-https)
9 - [Running over https](#running-over-https)
@@ -112,12 +111,6 @@ Firefox will not be able to properly run the development website due to [issue 4
112
111
113Every time you change the Haskell source files in frontend, common or backend, `ob run` will automatically recompile the modified files and reload the server. Furthermore, it will display on screen compilation errors and warnings if any.
112Every time you change the Haskell source files in frontend, common or backend, `ob run` will automatically recompile the modified files and reload the server. Furthermore, it will display on screen compilation errors and warnings if any.
114
113
115−### Hoogle
116−
117−To enter a nix-shell from which you can run the hoogle command-line client or a hoogle server for your project:
118−
119−`nix-shell -A shells.ghc --arg withHoogle true`
120−
121### Adding packages
114### Adding packages
122
115
123In order to add package dependencies, declare them under the build-depends field in the appropriate cabal files (backend, common, and frontend each have their own). The corresponding Nix packages will automatically be selected when building.
116In order to add package dependencies, declare them under the build-depends field in the appropriate cabal files (backend, common, and frontend each have their own). The corresponding Nix packages will automatically be selected when building.
all-builds.nix+36−47
@@ -38,21 +38,16 @@ let
38 (name: { inherit name; value = pkgsSet.${name}; })
38 (name: { inherit name; value = pkgsSet.${name}; })
39 pnames);
39 pnames);
40
40
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 [])
48− ];
49− };
50− }).out;
51− in pkgAttrs: builtins.concatLists (map extractDeps (builtins.attrValues pkgAttrs));
52
46
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; };
49+
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))
66− (concatDepends ghc)
67− (lib.optionals (!profiling) (concatDepends ghcjs))
68− (lib.optional reflex-platform.androidSupport androidSkeleton)
69− (lib.optional reflex-platform.iosSupport iosSkeleton)
70− (lib.optionals (!profiling) [
71− command
72− serverSkeletonExe
73− serverSkeletonShell
74− ])
75− ];
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";
88− in {
70+ packages = {
89− inherit
71+ inherit
72+ command
73+ serverSkeletonShell
90− ghc
74+ ghc
91− ;
75+ ;
92− cache = reflex-platform.pinBuildInputs "obelisk-${system}-${nameSuffix}" cachePackages;
93− } // lib.optionalAttrs (!profiling) {
76+ } // lib.optionalAttrs (!profiling) {
94− inherit
77+ inherit
95− command
96− ghcjs
78+ ghcjs
97− serverSkeletonExe
79+ serverSkeletonExe
98− serverSkeletonShell
99− ;
80+ ;
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;
85+ };
86+ in packages // {
87+ cache = reflex-platform.pinBuildInputs
88+ "obelisk-${system}-${nameSuffix}"
89+ (collect packages);
90+ };
91+
92+ perProfiling = {
93+ profiled = mkPerProfiling true;
94+ unprofiled = mkPerProfiling false;
104 };
95 };
105− profiled = perProfiling true;
96+ in perProfiling // {
106− unprofiled = perProfiling false;
107− cachePackages = map (p: p.cache) [ profiled unprofiled ];
108− in {
109− inherit profiled unprofiled;
110− cache = reflex-platform.pinBuildInputs "obelisk-${system}" cachePackages;
97+ cache = reflex-platform.pinBuildInputs
98+ "obelisk-${system}"
99+ (map (p: p.cache) (builtins.attrValues perProfiling));
111 });
100 });
112
101
113 metaCache = local-self.reflex-platform.pinBuildInputs
102 metaCache = local-self.reflex-platform.pinBuildInputs