2023-11-29 20:54:40 -08:00
|
|
|
{ stdenv, mkYarnModules, bergamot-elm }:
|
2023-11-29 20:36:46 -08:00
|
|
|
|
|
|
|
let
|
|
|
|
# Generate a Nix expression from the yarn.lock file
|
2023-11-29 20:54:40 -08:00
|
|
|
yarnModules = mkYarnModules {
|
|
|
|
version = "1.0.0";
|
|
|
|
pname = "web-files";
|
|
|
|
packageJSON = ./package.json;
|
2023-11-29 20:36:46 -08:00
|
|
|
yarnLock = ./yarn.lock;
|
|
|
|
};
|
|
|
|
|
|
|
|
in
|
2023-11-29 20:54:40 -08:00
|
|
|
stdenv.mkDerivation {
|
|
|
|
name = "web-files";
|
|
|
|
src = ./.;
|
|
|
|
|
|
|
|
# Use the generated yarnModules
|
|
|
|
buildInputs = [ yarnModules bergamot-elm ];
|
|
|
|
|
|
|
|
installPhase = ''
|
2023-12-30 14:44:04 -08:00
|
|
|
mkdir -p $out $out/katex $out/vis-network $out/normalize $out/katex-expression $out/bergamot
|
2023-11-29 20:54:40 -08:00
|
|
|
cp ${yarnModules}/node_modules/katex/dist/katex.min.css $out/katex
|
2023-12-30 14:44:04 -08:00
|
|
|
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
|
2023-11-29 22:07:21 -08:00
|
|
|
cp -r ${yarnModules}/node_modules/katex/dist/fonts $out/katex
|
2023-11-29 22:16:30 -08:00
|
|
|
cp ${yarnModules}/node_modules/@navsnpm/katex-expression/dist/katex-expression/* $out/katex-expression
|
2023-11-29 20:54:40 -08:00
|
|
|
cp ${bergamot-elm}/Main.min.js $out/bergamot/bergamot.js
|
|
|
|
'';
|
|
|
|
}
|