13 buildWebExtension ? false,
15 stdenv.mkDerivation (finalAttrs: {
19 src = fetchFromGitHub {
22 rev = "v${finalAttrs.version}";
23 hash = "sha256-2UOz8o+3jWppk6lWatbG0avcqBFpxHYSMEspCpFWWOk=";
26 pnpmDeps = pnpm.fetchDeps {
27 inherit (finalAttrs) pname src;
29 hash = "sha256-vVzERis1W3QZB/i6SQR9dQR56yDWadKWvFr+nLTQY9Y=";
39 ESBUILD_BINARY_PATH = lib.getExe (
40 esbuild.overrideAttrs (
43 src = fetchFromGitHub {
46 rev = "v${final.version}";
47 hash = "sha256-b9R1ML+pgRg9j2yrkQmBulPuLHYLUQvW+WTyR/Cq6zE=";
49 vendorHash = "sha256-+BfxCyg0KkDQpHt/wycy/8CTG6YBA/VJvJFhhzUnSiQ=";
53 VENCORD_REMOTE = "${finalAttrs.src.owner}/${finalAttrs.src.repo}";
54 VENCORD_HASH = "${finalAttrs.version}";
60 pnpm run ${if buildWebExtension then "buildWeb" else "build"} \
61 -- --standalone --disable-updater
69 cp -r dist/${lib.optionalString buildWebExtension "chromium-unpacked/"} $out
74 # We need to fetch the latest *tag* ourselves, as nix-update can only fetch the latest *releases* from GitHub
75 # Vencord had a single "devbuild" release that we do not care about
76 passthru.updateScript = writeShellScript "update-vencord" ''
84 ghTags=$(curl ''${GITHUB_TOKEN:+" -u \":$GITHUB_TOKEN\""} "https://api.github.com/repos/Vendicated/Vencord/tags")
85 latestTag=$(echo "$ghTags" | jq -r .[0].name)
87 echo "Latest tag: $latestTag"
89 exec nix-update --version "$latestTag" "$@"
93 description = "Vencord web extension";
94 homepage = "https://github.com/Vendicated/Vencord";
95 license = licenses.gpl3Only;
96 maintainers = with maintainers; [