nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 pnpm_10,
5 nodejs_22,
6 fetchFromGitHub,
7 nix-update-script,
8}:
9stdenv.mkDerivation (finalAttrs: {
10 pname = "moonlight";
11 version = "1.3.24";
12
13 src = fetchFromGitHub {
14 owner = "moonlight-mod";
15 repo = "moonlight";
16 tag = "v${finalAttrs.version}";
17 hash = "sha256-qyKn4qHEpGqis82ALjsog0iH6nM8HKMl4y1KLazXT7I=";
18 };
19
20 nativeBuildInputs = [
21 nodejs_22
22 pnpm_10.configHook
23 ];
24
25 pnpmDeps = pnpm_10.fetchDeps {
26 inherit (finalAttrs) pname version src;
27
28 buildInputs = [ nodejs_22 ];
29
30 fetcherVersion = 1;
31 hash = "sha256-Ij2jc5K0WpIIeI/iKXAdU+fxyqkWpkCuQSNqHvhkQS8=";
32 };
33
34 env = {
35 NODE_ENV = "production";
36 MOONLIGHT_BRANCH = "stable";
37 MOONLIGHT_VERSION = "v${finalAttrs.version} (nixpkgs)";
38 };
39
40 patches = [
41 ./disable_updates.patch
42 ];
43
44 buildPhase = ''
45 runHook preBuild
46
47 pnpm run build
48
49 runHook postBuild
50 '';
51
52 installPhase = ''
53 runHook preInstall
54
55 cp -r dist $out
56
57 runHook postInstall
58 '';
59
60 passthru.updateScript = nix-update-script { };
61
62 meta = with lib; {
63 description = "Discord client modification, focused on enhancing user and developer experience";
64 longDescription = ''
65 Moonlight is a ***passion project***—yet another Discord client mod—focused on providing a decent user
66 and developer experience. Heavily inspired by hh3 (a private client mod) and the projects before it, namely EndPwn.
67 All core code is original or used with permission from their respective authors where not copyleft.
68 '';
69 homepage = "https://moonlight-mod.github.io";
70 downloadPage = "https://moonlight-mod.github.io/using/install/#nix";
71 changelog = "https://raw.githubusercontent.com/moonlight-mod/moonlight/refs/tags/v${finalAttrs.version}/CHANGELOG.md";
72
73 license = licenses.lgpl3;
74 maintainers = with maintainers; [
75 ilys
76 donteatoreo
77 ];
78 };
79})