28 lines
725 B
Nix
28 lines
725 B
Nix
{ mkYarnModules, bergamot-elm }:
|
|
|
|
let
|
|
# Generate a Nix expression from the yarn.lock file
|
|
yarnModules = pkgs.mkYarnModules {
|
|
src = ./.;
|
|
packageJson = ./package.json;
|
|
yarnLock = ./yarn.lock;
|
|
};
|
|
|
|
in
|
|
pkgs.stdenv.mkDerivation {
|
|
name = "web-files";
|
|
|
|
# Use the generated yarnModules
|
|
buildInputs = [ yarnModules bergamot-elm ];
|
|
|
|
buildPhase = ''
|
|
'';
|
|
|
|
installPhase = ''
|
|
mkdir -p $out $out/katex $out/katex-expression $out/bergamot
|
|
cp ${yarnModules}/node_modules/katex/dist/katex.min.css $out/katex
|
|
cp ${yarnModules}/node_modules/@navsnpm/katex-expression/dist/katex-expression/katex-expression.esm.js $out/katex-expression
|
|
cp ${bergamot-elm}/Main.min.js $out/bergamot/bergamot.js
|
|
'';
|
|
}
|