on master help sign in
Hopefully fix asset serving
commitbac03d7e5065116486050561ae46fc5fd93d9fa9 authorRyan Trinkle <ryan.trinkle@gmail.com> dateSat 30 Jun 2018, 21:37 (8 years ago) parent667d38d
1 file changed+5−6
default.nix+5−6
default.nix+5−6
@@ -188,9 +188,9 @@ rec {
188188 mkdir $out
189189 set -eux
190190 ln -s "${justStaticExecutables backend}"/bin/backend $out/backend
191− ln -s "${assets}" $out/static
191+ ln -s "${assets}" $out/static.assets
192192 ln -s "${config}" $out/config
193− ln -s ${compressedJs frontend} $out/frontend.jsexe
193+ ln -s ${processAssets { src = compressedJs frontend; packageName = "frontend.jsexe"; moduleName = "FrontendJsexe"; }} $out/frontend.jsexe.assets
194194 ''; #TODO: run frontend.jsexe through the asset processing pipeline
195195
196196 server = { exe, hostName, adminEmail, routeHost, enableHttps }:
@@ -251,8 +251,8 @@ rec {
251251
252252 # An Obelisk project is a reflex-platform project with a predefined layout and role for each component
253253 project = base: projectDefinition:
254− let assets = processAssets { src = base + "/static"; };
255− configPath = base + "/config";
254+ let configPath = base + "/config";
255+ assets = processAssets { src = base + "/static"; };
256256 projectOut = sys: (getReflexPlatform sys).project (args@{ nixpkgs, ... }:
257257 let mkProject = { android ? null #TODO: Better error when missing
258258 , ios ? null #TODO: Better error when missing
@@ -264,7 +264,6 @@ rec {
264264 commonName = "common";
265265 staticName = "static";
266266 staticPath = base + "/static";
267− assets = processAssets { src = base + "/static"; };
268267 # The packages whose names and roles are defined by this package
269268 predefinedPackages = filterAttrs (_: x: x != null) {
270269 ${frontendName} = nullIfAbsent (base + "/frontend");
@@ -306,7 +305,7 @@ rec {
306305 };
307306 };
308307 in mkProject (projectDefinition args));
309− serverOn = sys: serverExe (projectOut sys).ghc.backend (projectOut system).ghcjs.frontend assets.symlinked configPath;
308+ serverOn = sys: serverExe (projectOut sys).ghc.backend (projectOut system).ghcjs.frontend assets configPath;
310309 linuxserver = serverOn "x86_64-linux";
311310 in projectOut system // {
312311 inherit linuxserver;