monal-rebuild/package.nix
pijukka 5bd0ac1540 package.nix: fix npmDepsHash, stale since libomemo.js/fake-indexeddb
The Nix build has been broken since Phase 1 added these dependencies
via npm directly, without rebuilding via Nix to catch the drift.
Found while preparing Phase 6 (deploy). Verified: nix-build now
succeeds, producing the same bundle as npm run build.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-04 22:35:21 +02:00

46 lines
1.1 KiB
Nix

# The static app, built from source. Hosts add their own config.js:
# (callPackage ./package.nix { }).override { configJs = "window.config = {…};"; }
# or copy $out and write config.js next to index.html (PLAN.md, Packaging).
{
lib,
buildNpmPackage,
nodejs,
writeText,
configJs ? null,
}:
buildNpmPackage {
pname = "0ff-chat";
version = (lib.importJSON ./package.json).version;
src = lib.fileset.toSource {
root = ./.;
fileset = lib.fileset.unions [
./index.html
./package.json
./package-lock.json
./public
./src
./tsconfig.json
./vite.config.ts
];
};
inherit nodejs;
npmDepsHash = "sha256-PGhjG4A/pDwgDMZEuxzfUr8UgUchRHn5s++/l8dfpYU=";
installPhase = ''
runHook preInstall
cp -r dist "$out"
${lib.optionalString (configJs != null) ''
cp ${writeText "config.js" configJs} "$out/config.js"
''}
runHook postInstall
'';
meta = {
description = "Monal-style XMPP web client for 0ff.space";
license = lib.licenses.bsd0;
platforms = lib.platforms.all;
};
}