26 haskellJS = ghc.callCabal2nix pname src { };
27 miso-lynx-node_modules = stdenv.mkDerivation {
28 pname = "miso-lynx-node_modules";
31 nativeBuildInputs = [ bun ];
33 # ExplanationNote: fixed-output derivation
34 # cannot reference Nix store paths,
35 # and the fixup phase would change /usr/bin/… into /nix/store/…
38 export BUN_INSTALL_CACHE_DIR=$(mktemp -d)
39 cp -v ${../nix/pkgs/miso-lynx/bun.lock} bun.lock
40 bun install --force --frozen-lockfile --no-progress --production
43 mkdir -p $out/node_modules
44 cp -R ./node_modules $out
46 # CorrectionNote: this has to be updated each time bun.lock is
47 # eg. with `bun install --lockfile-only`
48 outputHash = "sha256-9UsvyZt1PMlPrnEDxQGWN0SOutD826ORZ7ODxbSC8jo=";
49 outputHashAlgo = "sha256";
50 outputHashMode = "recursive";
52 mainLynxBundle = stdenv.mkDerivation {
54 version = haskellJS.version;
62 cp -r ${miso-lynx-node_modules}/node_modules .
63 substituteInPlace node_modules/.bin/rspack \
64 --replace-fail "#!/usr/bin/env" "#!${coreutils}/bin/env"
72 cp -v ${haskellJS}/bin/counter.jsexe/all.js .
73 bun build --minify all.js --target=bun --outfile=dist/all.js
82 cp -v dist/main.lynx.bundle $out/