# 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; }; }