{ lib, rustPlatform, stalwart, fetchFromGitHub, trunk, tailwindcss_3, fetchNpmDeps, nix-update-script, nodejs, npmHooks, llvmPackages, wasm-bindgen-cli_0_2_93, binaryen, zip, }: rustPlatform.buildRustPackage (finalAttrs: { pname = "webadmin"; version = "0.1.37"; src = fetchFromGitHub { owner = "stalwartlabs"; repo = "webadmin"; tag = "v${finalAttrs.version}"; hash = ""; }; npmDeps = fetchNpmDeps { name = "${finalAttrs.pname}-npm-deps"; hash = ""; }; cargoHash = ""; postPatch = '' # Using local tailwindcss for compilation substituteInPlace Trunk.toml --replace-fail "npx tailwindcss" "tailwindcss" ''; nativeBuildInputs = [ binaryen llvmPackages.bintools-unwrapped nodejs npmHooks.npmConfigHook tailwindcss_3 trunk # needs to match with wasm-bindgen version in upstreams Cargo.lock wasm-bindgen-cli_0_2_93 zip ]; env.NODE_PATH = "$npmDeps"; buildPhase = '' trunk build --offline --frozen --release ''; installPhase = '' cd dist mkdir -p $out zip -r $out/webadmin.zip * ''; passthru = { updateScript = nix-update-script { }; }; meta = { description = "Web administration module for the Stalwart server"; homepage = "https://github.com/stalwartlabs/webadmin"; changelog = "https://github.com/stalwartlabs/webadmin/blob/${finalAttrs.src.tag}/CHANGELOG.md"; license = lib.licenses.agpl3Only; # inherit (stalwart.meta) maintainers; }; })