{ fetchFromGitHub, git, lib, nodejs, pnpm_10, stdenv, nix-update-script, discord, discord-ptb, discord-canary, discord-development, buildWebExtension ? false, }: stdenv.mkDerivation (finalAttrs: { pname = "equicord"; # Upstream discourages inferring the package version from the package.json found in # the Equicord repository. Dates as tags (and automatic releases) were the compromise # we came to with upstream. Please do not change the version schema (e.g., to semver) # unless upstream changes the tag schema from dates. version = "2025-10-05"; src = fetchFromGitHub { owner = "Equicord"; repo = "Equicord"; tag = "${finalAttrs.version}"; hash = "sha256-29akM1A7wFI+uZJ2r6K+2djYoZ6zI/rcYROU++x4j8k="; }; pnpmDeps = pnpm_10.fetchDeps { inherit (finalAttrs) pname version src; fetcherVersion = 1; hash = "sha256-SsvkIgIXKYBgiHOMt9+IX8pXSYvXr8ESgHJm0mzBWlU="; }; nativeBuildInputs = [ git nodejs pnpm_10.configHook ]; env = { EQUICORD_REMOTE = "${finalAttrs.src.owner}/${finalAttrs.src.repo}"; EQUICORD_HASH = "${finalAttrs.src.tag}"; }; buildPhase = '' runHook preBuild pnpm run ${if buildWebExtension then "buildWeb" else "build"} \ -- --standalone --disable-updater runHook postBuild ''; installPhase = '' runHook preInstall cp -r dist/${lib.optionalString buildWebExtension "chromium-unpacked/"} $out runHook postInstall ''; passthru = { updateScript = nix-update-script { extraArgs = [ "--version-regex" "^(\\d{4}-\\d{2}-\\d{2})$" ]; }; tests = lib.genAttrs' [ discord discord-ptb discord-canary discord-development ] ( p: lib.nameValuePair p.pname p.tests.withEquicord ); }; meta = { description = "Other cutest Discord client mod"; homepage = "https://github.com/Equicord/Equicord"; license = lib.licenses.gpl3Only; platforms = lib.platforms.linux; maintainers = [ lib.maintainers.NotAShelf ]; }; })