107 lines
3.6 KiB
Nix
107 lines
3.6 KiB
Nix
{ branch ? "stable", callPackage, fetchurl, lib, stdenv }:
|
|
let
|
|
versions =
|
|
if stdenv.isLinux then {
|
|
stable = "0.0.39";
|
|
ptb = "0.0.63";
|
|
canary = "0.0.224";
|
|
development = "0.0.1";
|
|
} else {
|
|
stable = "0.0.289";
|
|
ptb = "0.0.91";
|
|
canary = "0.0.374";
|
|
development = "0.0.15";
|
|
};
|
|
version = versions.${branch};
|
|
srcs = rec {
|
|
x86_64-linux = {
|
|
stable = fetchurl {
|
|
url = "https://dl.discordapp.net/apps/linux/${version}/discord-${version}.tar.gz";
|
|
hash = "sha256-KZLKBzd9hdOQkp7mN0rUZ8TbMvH2G0/AfwHPLAlDpug=";
|
|
};
|
|
ptb = fetchurl {
|
|
url = "https://dl-ptb.discordapp.net/apps/linux/${version}/discord-ptb-${version}.tar.gz";
|
|
hash = "sha256-yJ+EGFpTD0GP9rK4WM6wRZ6HP+zfQ0l3tMHMnNNym5g=";
|
|
};
|
|
canary = fetchurl {
|
|
url = "https://dl-canary.discordapp.net/apps/linux/${version}/discord-canary-${version}.tar.gz";
|
|
hash = "sha256-SDF4woekFmy6VUqYTfSZi4aqtZ5ARgaex6+8qOMSHMQ=";
|
|
};
|
|
development = fetchurl {
|
|
url = "https://dl-development.discordapp.net/apps/linux/${version}/discord-development-${version}.tar.gz";
|
|
hash = "sha256-unzPakomF2hmiikrNfnOueBdcuZCz2z3oCA7Djn6OmY=";
|
|
};
|
|
};
|
|
x86_64-darwin = {
|
|
stable = fetchurl {
|
|
url = "https://dl.discordapp.net/apps/osx/${version}/Discord.dmg";
|
|
hash = "sha256-3XaiaWdP7GSnMeR6yU5lfeumrVm6WpUmitVuSs+xAvE=";
|
|
};
|
|
ptb = fetchurl {
|
|
url = "https://dl-ptb.discordapp.net/apps/osx/${version}/DiscordPTB.dmg";
|
|
hash = "sha256-8pAoi8rAaHC17GxlDGEJxGX726qRe1LVMTQK6SngniM=";
|
|
};
|
|
canary = fetchurl {
|
|
url = "https://dl-canary.discordapp.net/apps/osx/${version}/DiscordCanary.dmg";
|
|
hash = "sha256-CiE33dAcX/aAjOncpX62KX+XfrRd5FgH8qQ2picwe6Q=";
|
|
};
|
|
development = fetchurl {
|
|
url = "https://dl-development.discordapp.net/apps/osx/${version}/DiscordDevelopment.dmg";
|
|
hash = "sha256-Fxxrjkj3W1MagT4rCxVEtip1W9MImsdQOuHXKPKsEtM=";
|
|
};
|
|
};
|
|
aarch64-darwin = x86_64-darwin;
|
|
};
|
|
src = srcs.${stdenv.hostPlatform.system}.${branch};
|
|
|
|
meta = with lib; {
|
|
description = "All-in-one cross-platform voice and text chat for gamers";
|
|
homepage = "https://discordapp.com/";
|
|
downloadPage = "https://discordapp.com/download";
|
|
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
|
|
license = licenses.unfree;
|
|
maintainers = with maintainers; [ MP2E Scrumplex artturin infinidoge jopejoe1 ];
|
|
platforms = [ "x86_64-linux" "x86_64-darwin" "aarch64-darwin" ];
|
|
mainProgram = "discord";
|
|
};
|
|
package =
|
|
if stdenv.isLinux
|
|
then ./linux.nix
|
|
else ./darwin.nix;
|
|
|
|
openasar = callPackage ./openasar.nix { };
|
|
|
|
packages = (
|
|
builtins.mapAttrs
|
|
(_: value:
|
|
callPackage package (value
|
|
// {
|
|
inherit src version openasar branch;
|
|
meta = meta // { mainProgram = value.binaryName; };
|
|
}))
|
|
{
|
|
stable = rec {
|
|
pname = "discord";
|
|
binaryName = "Discord";
|
|
desktopName = "Discord";
|
|
};
|
|
ptb = rec {
|
|
pname = "discord-ptb";
|
|
binaryName = if stdenv.isLinux then "DiscordPTB" else desktopName;
|
|
desktopName = "Discord PTB";
|
|
};
|
|
canary = rec {
|
|
pname = "discord-canary";
|
|
binaryName = if stdenv.isLinux then "DiscordCanary" else desktopName;
|
|
desktopName = "Discord Canary";
|
|
};
|
|
development = rec {
|
|
pname = "discord-development";
|
|
binaryName = if stdenv.isLinux then "DiscordDevelopment" else desktopName;
|
|
desktopName = "Discord Development";
|
|
};
|
|
}
|
|
);
|
|
in
|
|
packages.${branch}
|