-
Notifications
You must be signed in to change notification settings - Fork 9
/
vencord.nix
95 lines (80 loc) · 2.31 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
# 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,
stdenv,
buildWebExtension ? false,
unstable ? false,
}:
let
stableVersion = "1.10.9";
stableHash = "sha256-sU2eJUUw7crvzMGGBQP6rbxISkL+S5nmT3QspyYXlRQ=";
unstableVersion = "1.10.9-unstable-2024-12-30";
unstableRev = "0fd76ab15a51a8426786b696d422f59bd1250099";
unstableHash = "sha256-S49O3ph0HMUAkqhAhoviaF2vpc1h1pVX/78mn/PafH4=";
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.fetchDeps {
inherit (finalAttrs) pname src;
hash = "sha256-vVzERis1W3QZB/i6SQR9dQR56yDWadKWvFr+nLTQY9Y=";
};
nativeBuildInputs = [
git
nodejs
pnpm.configHook
];
env = {
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=";
}
)
);
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
];
};
})