Files
nixpkgs/pkgs/by-name/ve/vencord/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

102 lines
2.3 KiB
Nix

{
curl,
fetchFromGitHub,
git,
jq,
lib,
nix-update,
nodejs,
pnpm_10,
stdenv,
writeShellScript,
discord,
discord-ptb,
discord-canary,
discord-development,
buildWebExtension ? false,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "vencord";
version = "1.13.1";
src = fetchFromGitHub {
owner = "Vendicated";
repo = "Vencord";
tag = "v${finalAttrs.version}";
hash = "sha256-FqRRpsS1NPpxJr6iaDvQJ3fuX07oo08lZ6f+oEQb3MM=";
};
pnpmDeps = pnpm_10.fetchDeps {
inherit (finalAttrs) pname src;
fetcherVersion = 2;
hash = "sha256-JP9HOaP3DG+2F89tC77JZFD0ls35u/MzxNmvMCbBo9Y=";
};
nativeBuildInputs = [
git
nodejs
pnpm_10.configHook
];
env = {
VENCORD_REMOTE = "${finalAttrs.src.owner}/${finalAttrs.src.repo}";
VENCORD_HASH = "${finalAttrs.version}";
};
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
cp package.json $out # Presence is checked by Vesktop.
runHook postInstall
'';
passthru = {
# We need to fetch the latest *tag* ourselves, as nix-update can only fetch the latest *releases* from GitHub
# Vencord had a single "devbuild" release that we do not care about
updateScript = writeShellScript "update-vencord" ''
export PATH="${
lib.makeBinPath [
curl
jq
nix-update
]
}:$PATH"
ghTags=$(curl ''${GITHUB_TOKEN:+" -u \":$GITHUB_TOKEN\""} "https://api.github.com/repos/Vendicated/Vencord/tags")
latestTag=$(echo "$ghTags" | jq -r .[0].name)
echo "Latest tag: $latestTag"
exec nix-update --version "$latestTag" "$@"
'';
tests = lib.genAttrs' [ discord discord-ptb discord-canary discord-development ] (
p: lib.nameValuePair p.pname p.tests.withVencord
);
};
meta = {
description = "Cutest Discord client mod";
homepage = "https://github.com/Vendicated/Vencord";
license = lib.licenses.gpl3Only;
maintainers = with lib.maintainers; [
FlameFlag
FlafyDev
Gliczy
NotAShelf
Scrumplex
];
};
})