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.41";
|
|
ptb = "0.0.66";
|
|
canary = "0.0.257";
|
|
development = "0.0.11";
|
|
} else {
|
|
stable = "0.0.291";
|
|
ptb = "0.0.94";
|
|
canary = "0.0.394";
|
|
development = "0.0.18";
|
|
};
|
|
version = versions.${branch};
|
|
srcs = rec {
|
|
x86_64-linux = {
|
|
stable = fetchurl {
|
|
url = "https://dl.discordapp.net/apps/linux/${version}/discord-${version}.tar.gz";
|
|
hash = "sha256-yzCOlYIDvbhJRbiqf5NC2iBT2ezlJP81O/wtkWIEp+U=";
|
|
};
|
|
ptb = fetchurl {
|
|
url = "https://dl-ptb.discordapp.net/apps/linux/${version}/discord-ptb-${version}.tar.gz";
|
|
hash = "sha256-3ocygqp8eiF3n/BVlTp1T1CRsGj56MGp1yPsvBE7/H4=";
|
|
};
|
|
canary = fetchurl {
|
|
url = "https://dl-canary.discordapp.net/apps/linux/${version}/discord-canary-${version}.tar.gz";
|
|
hash = "sha256-2AUCTWKEB4cy2tFfnJMn8Ywz1B8a3H6yhkVIcB0fLME=";
|
|
};
|
|
development = fetchurl {
|
|
url = "https://dl-development.discordapp.net/apps/linux/${version}/discord-development-${version}.tar.gz";
|
|
hash = "sha256-bN77yfmz/W3ohSKHV4pwnKEET6yi3p29ZfqH1BvFqXs=";
|
|
};
|
|
};
|
|
x86_64-darwin = {
|
|
stable = fetchurl {
|
|
url = "https://dl.discordapp.net/apps/osx/${version}/Discord.dmg";
|
|
hash = "sha256-k0A5xBWG8cXhDp/d3dw5Eu1cpqayfOzrnwXK8i2CtVE=";
|
|
};
|
|
ptb = fetchurl {
|
|
url = "https://dl-ptb.discordapp.net/apps/osx/${version}/DiscordPTB.dmg";
|
|
hash = "sha256-SUCVLCorwqQTkJs3UJguBYZwE1lrJgmZ9BU8fHIRgLE=";
|
|
};
|
|
canary = fetchurl {
|
|
url = "https://dl-canary.discordapp.net/apps/osx/${version}/DiscordCanary.dmg";
|
|
hash = "sha256-lgnZEkXxfn1L5QUBGXcKrIEL5kEehRIc0HF3WXgB8yo=";
|
|
};
|
|
development = fetchurl {
|
|
url = "https://dl-development.discordapp.net/apps/osx/${version}/DiscordDevelopment.dmg";
|
|
hash = "sha256-q/8hHRBK9Quj2S1n5QQC3u3yF9OvxqWrC+ge4Jh9i0U=";
|
|
};
|
|
};
|
|
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}
|