13 buildWebExtension ? false,
15 stdenv.mkDerivation (finalAttrs: {
19 src = fetchFromGitHub {
22 rev = "v${finalAttrs.version}";
23 hash = "sha256-lAMcvJzKFpIvA4QzCnhJddu8EL2SE4iYNvkqesHzsb8=";
26 pnpmDeps = pnpm.fetchDeps {
27 inherit (finalAttrs) pname src;
29 hash = "sha256-bosCE9gBFCcM3Ww6sJmhps/cl4lovXKMieYpkqAMst8=";
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 # TODO: somehow update this automatically
55 VENCORD_HASH = "deadbeef";
61 pnpm run ${if buildWebExtension then "buildWeb" else "build"} \
62 -- --standalone --disable-updater
70 cp -r dist/${lib.optionalString buildWebExtension "chromium-unpacked/"} $out
75 # We need to fetch the latest *tag* ourselves, as nix-update can only fetch the latest *releases* from GitHub
76 # Vencord had a single "devbuild" release that we do not care about
77 passthru.updateScript = writeShellScript "update-vencord" ''
85 ghTags=$(curl ''${GITHUB_TOKEN:+" -u \":$GITHUB_TOKEN\""} "https://api.github.com/repos/Vendicated/Vencord/tags")
86 latestTag=$(echo "$ghTags" | jq -r .[0].name)
88 echo "Latest tag: $latestTag"
90 exec nix-update --version "$latestTag" "$@"
94 description = "Vencord web extension";
95 homepage = "https://github.com/Vendicated/Vencord";
96 license = licenses.gpl3Only;
97 maintainers = with maintainers; [