-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathvencord.nix
96 lines (82 loc) · 2.46 KB
/
vencord.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# Made from nixpkgs pkg and updated with nix-update
# identical to nixpkgs source, but maintained here for
# quicker updates that don't wait on hydra
{
esbuild,
fetchFromGitHub,
git,
lib,
nodejs,
pnpm_9,
stdenv,
buildWebExtension ? false,
unstable ? false,
}:
let
stableVersion = "1.11.5";
stableHash = "sha256-hdlFL95DFVeUs08/wg6EA5CfV6KeUGaS9kcLGRMyNgY=";
stablePnpmDeps = "sha256-0afgeJkK0OQWoqF0b8pHPMsiTKox84YmwBhtNWGyVAg=";
unstableVersion = "1.11.4-unstable-2025-02-12";
unstableRev = "205e07d2c5b908f29d2a463845d7a1417a4678ad";
unstableHash = "sha256-A2vv3ubT+3ksqgLC+RvyGQGlw2GUD3qOyU0ZmQdbC3U=";
unstablePnpmDeps = "sha256-ZUwtNtOmxjhOBpYB7vuytunGBRSuVxdlQsceRmeyhhI=";
in
stdenv.mkDerivation (finalAttrs: {
pname = "vencord" + lib.optionalString unstable "-unstable";
version = if unstable then unstableVersion else stableVersion;
src = fetchFromGitHub {
owner = "Vendicated";
repo = "Vencord";
rev = if unstable then unstableRev else "v${finalAttrs.version}";
hash = if unstable then unstableHash else stableHash;
};
pnpmDeps = pnpm_9.fetchDeps {
inherit (finalAttrs) pname src;
hash = if unstable then unstablePnpmDeps else stablePnpmDeps;
};
nativeBuildInputs = [
git
nodejs
pnpm_9.configHook
];
env = {
ESBUILD_BINARY_PATH = lib.getExe (
esbuild.overrideAttrs (
final: _: {
version = "0.25.0";
src = fetchFromGitHub {
owner = "evanw";
repo = "esbuild";
rev = "v${final.version}";
hash = "sha256-L9jm94Epb22hYsU3hoq1lZXb5aFVD4FC4x2qNt0DljA=";
};
vendorHash = "sha256-+BfxCyg0KkDQpHt/wycy/8CTG6YBA/VJvJFhhzUnSiQ=";
}
)
);
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
runHook postInstall
'';
meta = with lib; {
description = "Vencord web extension" + lib.optionalString unstable " (Unstable)";
homepage = "https://github.com/Vendicated/Vencord";
license = licenses.gpl3Only;
maintainers = with maintainers; [
FlafyDev
NotAShelf
Scrumplex
donteatoreo
];
};
})