31 lines
1.1 KiB
Nix
31 lines
1.1 KiB
Nix
{ stdenv, mkYarnModules, bergamot-elm }:
|
|
|
|
let
|
|
# Generate a Nix expression from the yarn.lock file
|
|
yarnModules = mkYarnModules {
|
|
version = "1.0.0";
|
|
pname = "web-files";
|
|
packageJSON = ./package.json;
|
|
yarnLock = ./yarn.lock;
|
|
};
|
|
|
|
in
|
|
stdenv.mkDerivation {
|
|
name = "web-files";
|
|
src = ./.;
|
|
|
|
# Use the generated yarnModules
|
|
buildInputs = [ yarnModules bergamot-elm ];
|
|
|
|
installPhase = ''
|
|
mkdir -p $out $out/katex $out/vis-network $out/normalize $out/katex-expression $out/bergamot
|
|
cp ${yarnModules}/node_modules/katex/dist/katex.min.css $out/katex
|
|
cp ${yarnModules}/node_modules/katex/dist/katex.min.js $out/katex
|
|
cp ${yarnModules}/node_modules/vis-network/dist/vis-network.min.js $out/vis-network
|
|
cp ${yarnModules}/node_modules/normalize.css/normalize.css $out/normalize/normalize.css
|
|
cp -r ${yarnModules}/node_modules/katex/dist/fonts $out/katex
|
|
cp ${bergamot-elm}/Main.min.js $out/bergamot/bergamot.js
|
|
cp ${bergamot-elm}/Bergamot.ObjectLanguage.min.js $out/bergamot/objectlang.js
|
|
'';
|
|
}
|