106 lines
3.6 KiB
Nix
106 lines
3.6 KiB
Nix
{ branch ? "stable", callPackage, fetchurl, lib, stdenv }:
|
|
let
|
|
versions = if stdenv.isLinux then {
|
|
stable = "0.0.32";
|
|
ptb = "0.0.51";
|
|
canary = "0.0.170";
|
|
development = "0.0.234";
|
|
} else {
|
|
stable = "0.0.280";
|
|
ptb = "0.0.80";
|
|
canary = "0.0.315";
|
|
development = "0.0.8797";
|
|
};
|
|
version = versions.${branch};
|
|
srcs = rec {
|
|
x86_64-linux = {
|
|
stable = fetchurl {
|
|
url = "https://dl.discordapp.net/apps/linux/${version}/discord-${version}.tar.gz";
|
|
hash = "sha256-XeGDKRKnvDyl0AWm9Vs/PDeIfAq/FL9AsjLt+dNg1HQ=";
|
|
};
|
|
ptb = fetchurl {
|
|
url = "https://dl-ptb.discordapp.net/apps/linux/${version}/discord-ptb-${version}.tar.gz";
|
|
hash = "sha256-VlvGZ5qy61zse0mhvrROYwr0C94Zy1Kh4D4dp+sJTN0=";
|
|
};
|
|
canary = fetchurl {
|
|
url = "https://dl-canary.discordapp.net/apps/linux/${version}/discord-canary-${version}.tar.gz";
|
|
hash = "sha256-Lw+qLAAwyoDBKDPOBA9HR79gcnqwTshFq6GMpFS0tXA=";
|
|
};
|
|
development = fetchurl {
|
|
url = "https://dl-development.discordapp.net/apps/linux/${version}/discord-development-${version}.tar.gz";
|
|
hash = "sha256-R5UwgpXgb32mEohTzyRVXmumcgPl8UPan3UjmLFLxLo=";
|
|
};
|
|
};
|
|
x86_64-darwin = {
|
|
stable = fetchurl {
|
|
url = "https://dl.discordapp.net/apps/osx/${version}/Discord.dmg";
|
|
hash = "sha256-SUbpzd8RIf+e+so/dXZh5OkjCvWRC+EyqgeIg4u32Hg=";
|
|
};
|
|
ptb = fetchurl {
|
|
url = "https://dl-ptb.discordapp.net/apps/osx/${version}/DiscordPTB.dmg";
|
|
hash = "sha256-IvrCjiZ5Oa616+U8C2ihg8THj7ePV2A8+82wUWqWoPY=";
|
|
};
|
|
canary = fetchurl {
|
|
url = "https://dl-canary.discordapp.net/apps/osx/${version}/DiscordCanary.dmg";
|
|
hash = "sha256-m43SijSBxcAvYAlSFpQKIFILUm4AgSQ5F4XyQJyftts=";
|
|
};
|
|
development = fetchurl {
|
|
url = "https://dl-development.discordapp.net/apps/osx/${version}/DiscordDevelopment.dmg";
|
|
hash = "sha256-ra0El4Y7SqanY6ZBbHE1Y+pqel4OD7nXKKfg/vndULo=";
|
|
};
|
|
};
|
|
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}
|