mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-07-06 17:13:24 -05:00
93 lines
2.1 KiB
Nix
93 lines
2.1 KiB
Nix
{
|
|
lib,
|
|
stdenv,
|
|
pnpm_10,
|
|
fetchPnpmDeps,
|
|
pnpmConfigHook,
|
|
nodejs,
|
|
fetchFromGitHub,
|
|
nix-update-script,
|
|
discord,
|
|
discord-ptb,
|
|
discord-canary,
|
|
discord-development,
|
|
}:
|
|
let
|
|
pnpm = pnpm_10;
|
|
in
|
|
stdenv.mkDerivation (finalAttrs: {
|
|
pname = "moonlight";
|
|
version = "2026.5.2";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "moonlight-mod";
|
|
repo = "moonlight";
|
|
tag = "v${finalAttrs.version}";
|
|
hash = "sha256-eTya6Y7dw/otqohgYZudkqrcI50740jFUTe4Lyd6GKc=";
|
|
};
|
|
|
|
nativeBuildInputs = [
|
|
nodejs
|
|
pnpmConfigHook
|
|
pnpm
|
|
];
|
|
|
|
pnpmDeps = fetchPnpmDeps {
|
|
inherit (finalAttrs) pname version src;
|
|
inherit pnpm;
|
|
fetcherVersion = 3;
|
|
hash = "sha256-+jxp3dD/SyGdskMyw0jhDzDRj7wXD4Egkx3ok3cMiyc=";
|
|
};
|
|
|
|
env = {
|
|
NODE_ENV = "production";
|
|
MOONLIGHT_BRANCH = "stable";
|
|
MOONLIGHT_VERSION = "v${finalAttrs.version} (nixpkgs)";
|
|
};
|
|
|
|
patches = [
|
|
./disable_updates.patch
|
|
];
|
|
|
|
buildPhase = ''
|
|
runHook preBuild
|
|
|
|
pnpm run build
|
|
|
|
runHook postBuild
|
|
'';
|
|
|
|
installPhase = ''
|
|
runHook preInstall
|
|
|
|
cp -r dist $out
|
|
|
|
runHook postInstall
|
|
'';
|
|
|
|
passthru = {
|
|
updateScript = nix-update-script { };
|
|
tests = lib.genAttrs' [ discord discord-ptb discord-canary discord-development ] (
|
|
p: lib.nameValuePair p.pname p.tests.withMoonlight
|
|
);
|
|
};
|
|
|
|
meta = {
|
|
description = "Discord client modification, focused on enhancing user and developer experience";
|
|
longDescription = ''
|
|
Moonlight is a ***passion project***—yet another Discord client mod—focused on providing a decent user
|
|
and developer experience. Heavily inspired by hh3 (a private client mod) and the projects before it, namely EndPwn.
|
|
All core code is original or used with permission from their respective authors where not copyleft.
|
|
'';
|
|
homepage = "https://moonlight-mod.github.io";
|
|
downloadPage = "https://moonlight-mod.github.io/using/install/#nix";
|
|
changelog = "https://raw.githubusercontent.com/moonlight-mod/moonlight/refs/tags/v${finalAttrs.version}/CHANGELOG.md";
|
|
|
|
license = lib.licenses.lgpl3;
|
|
maintainers = with lib.maintainers; [
|
|
ilys
|
|
_4evy
|
|
isabelroses
|
|
];
|
|
};
|
|
})
|