-
Notifications
You must be signed in to change notification settings - Fork 4
/
release.nix
41 lines (33 loc) · 1 KB
/
release.nix
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
35
36
37
38
39
40
41
let
ob = import ./default.nix {};
inherit (ob.obelisk.nixpkgs) pkgs;
bootstrap4 = import ./nix/twitterBootstrap4.nix;
staticAssets = pkgs.stdenv.mkDerivation {
name = "FantasticWaddleCSS";
version = "0.0.1";
src = ./static;
dontBuild = true;
installPhase = ''
mkdir -p $out/css
cp -R css/* $out/css/
'';
};
buildFrontend = minFe: pkgs.runCommand "buildFrontend" { buildInputs = [ pkgs.zopfli ]; } ''
mkdir -p $out
mkdir -p $out/css
ln -s ${staticAssets}/css/* $out/css/
ln -sf ${bootstrap4.out}/css/bootstrap.min.css $out/css/bootstrap.min.css
ln -sf ${bootstrap4.out}/css/bootstrap.min.css.map $out/css/bootstrap.min.css.map
mkdir -p $out/js
ln -s ${minFe}/all.js $out/js/all.min.js
ln -s ${minFe}/all.js.map $out/js/all.min.js.map
cd $out/js
zopfli -i1000 all.min.js
'';
out = {
# Version 3
staticAssets = staticAssets;
minifiedFrontend = buildFrontend (ob.obelisk.compressedJs ob.ghcjs.frontend);
};
in
out