-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdefault.nix
More file actions
34 lines (32 loc) · 1023 Bytes
/
default.nix
File metadata and controls
34 lines (32 loc) · 1023 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
let
reflex-platform = import ./reflex-platform {};
platform-customize = import ./platform.nix { inherit reflex-platform; };
build = platform-customize.callPackage ./package.nix {};
indexHtml = ''
<!DOCTYPE html>
<html>
<head>
<title>myawesomeclient</title>
</head>
<body>
</body>
<script language="javascript" src="app.min.js.gz"></script>
</html>
'';
releaseBuild = reflex-platform.nixpkgs.stdenv.mkDerivation {
inherit (build) name version;
buildCommand = ''
mkdir -p $out
cp ${build}/bin/myawesomeclient-exe.jsexe/{rts,lib,out,runmain}.js $out
${reflex-platform.nixpkgs.closurecompiler}/bin/closure-compiler ${build}/bin/myawesomeclient-exe.jsexe/all.js \
--compilation_level=ADVANCED_OPTIMIZATIONS \
--externs=${build}/bin/myawesomeclient-exe.jsexe/all.js.externs \
> $out/app.min.js
gzip $out/app.min.js
cat <<EOF > $out/index.html
${indexHtml}
EOF
'';
};
in
releaseBuild