nixpkgs-suyu/pkgs/misc/vencord/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

66 lines
1.6 KiB
Nix
Raw Normal View History

{ buildNpmPackage
, fetchFromGitHub
, lib
, esbuild
, buildWebExtension ? false
}:
let
2024-03-23 06:49:57 +01:00
version = "1.7.3";
gitHash = "caa14ec";
in
buildNpmPackage rec {
pname = "vencord";
inherit version;
src = fetchFromGitHub {
owner = "Vendicated";
repo = "Vencord";
rev = "v${version}";
2024-03-23 06:49:57 +01:00
hash = "sha256-BsM7Gt1NEsZu/rxK58+Tix1xIJr6RvgbdjxVnro2soA=";
};
ESBUILD_BINARY_PATH = lib.getExe (esbuild.overrideAttrs (final: _: {
version = "0.15.18";
src = fetchFromGitHub {
owner = "evanw";
repo = "esbuild";
rev = "v${final.version}";
hash = "sha256-b9R1ML+pgRg9j2yrkQmBulPuLHYLUQvW+WTyR/Cq6zE=";
};
vendorHash = "sha256-+BfxCyg0KkDQpHt/wycy/8CTG6YBA/VJvJFhhzUnSiQ=";
}));
# Supresses an error about esbuild's version.
npmRebuildFlags = [ "|| true" ];
2023-09-27 20:42:17 +02:00
makeCacheWritable = true;
2024-03-23 06:49:57 +01:00
npmDepsHash = "sha256-XRVxF0dW0HIsLtijvxM/feW6rI/c4LsnA6Tmrp51arE=";
npmFlags = [ "--legacy-peer-deps" ];
npmBuildScript = if buildWebExtension then "buildWeb" else "build";
npmBuildFlags = [ "--" "--standalone" "--disable-updater" ];
prePatch = ''
cp ${./package-lock.json} ./package-lock.json
2023-09-27 20:42:17 +02:00
chmod +w ./package-lock.json
'';
VENCORD_HASH = gitHash;
VENCORD_REMOTE = "${src.owner}/${src.repo}";
installPhase =
if buildWebExtension then ''
cp -r dist/chromium-unpacked/ $out
'' else ''
cp -r dist/ $out
'';
passthru.updateScript = ./update.sh;
meta = with lib; {
description = "Vencord web extension";
homepage = "https://github.com/Vendicated/Vencord";
license = licenses.gpl3Only;
2023-10-03 18:24:38 +02:00
maintainers = with maintainers; [ FlafyDev fwam NotAShelf Scrumplex ];
};
}