2022-07-02 13:51:25 +00:00
|
|
|
{ branch ? "stable", callPackage, fetchurl, lib, stdenv }:
|
2019-06-19 05:39:15 +00:00
|
|
|
let
|
2023-12-11 14:36:30 +00:00
|
|
|
versions =
|
|
|
|
if stdenv.isLinux then {
|
2024-04-10 17:32:43 +00:00
|
|
|
stable = "0.0.49";
|
2024-03-22 20:31:26 +00:00
|
|
|
ptb = "0.0.76";
|
2024-03-27 18:03:18 +00:00
|
|
|
canary = "0.0.326";
|
2024-03-22 20:29:55 +00:00
|
|
|
development = "0.0.16";
|
2023-12-11 14:36:30 +00:00
|
|
|
} else {
|
2024-03-27 18:02:14 +00:00
|
|
|
stable = "0.0.298";
|
2024-03-27 18:08:07 +00:00
|
|
|
ptb = "0.0.105";
|
2024-03-27 18:04:23 +00:00
|
|
|
canary = "0.0.451";
|
2024-03-27 18:08:37 +00:00
|
|
|
development = "0.0.39";
|
2023-12-11 14:36:30 +00:00
|
|
|
};
|
2022-01-14 17:30:55 +00:00
|
|
|
version = versions.${branch};
|
2022-06-27 20:59:02 +00:00
|
|
|
srcs = rec {
|
2022-01-14 17:30:55 +00:00
|
|
|
x86_64-linux = {
|
|
|
|
stable = fetchurl {
|
2022-06-27 20:59:02 +00:00
|
|
|
url = "https://dl.discordapp.net/apps/linux/${version}/discord-${version}.tar.gz";
|
2024-04-10 17:32:43 +00:00
|
|
|
hash = "sha256-rVSYAkTZTlurnbUeYJFCgsPcsCqjJ1bJneQQiyhmvwQ=";
|
2022-01-14 17:30:55 +00:00
|
|
|
};
|
|
|
|
ptb = fetchurl {
|
2022-06-27 20:59:02 +00:00
|
|
|
url = "https://dl-ptb.discordapp.net/apps/linux/${version}/discord-ptb-${version}.tar.gz";
|
2024-03-22 20:31:26 +00:00
|
|
|
hash = "sha256-Gj6OLzkHrEQ2CeEQpICaAh1m13DpM2cpNVsebBJ0MVc=";
|
2022-01-14 17:30:55 +00:00
|
|
|
};
|
|
|
|
canary = fetchurl {
|
2022-07-15 14:40:31 +00:00
|
|
|
url = "https://dl-canary.discordapp.net/apps/linux/${version}/discord-canary-${version}.tar.gz";
|
2024-03-27 18:03:18 +00:00
|
|
|
hash = "sha256-MxiFhd7tLvL1tBRc451qjCFZlmGM8IolckExp0sR3y8=";
|
2022-01-14 17:30:55 +00:00
|
|
|
};
|
2023-05-02 10:45:21 +00:00
|
|
|
development = fetchurl {
|
|
|
|
url = "https://dl-development.discordapp.net/apps/linux/${version}/discord-development-${version}.tar.gz";
|
2024-03-22 20:29:55 +00:00
|
|
|
hash = "sha256-6QImWsNmL2JveB2QJ1MyBxkVEQfdPvKEdenRPjURptI=";
|
2023-05-02 10:45:21 +00:00
|
|
|
};
|
2022-01-14 17:30:55 +00:00
|
|
|
};
|
2022-11-05 12:51:32 +00:00
|
|
|
x86_64-darwin = {
|
|
|
|
stable = fetchurl {
|
|
|
|
url = "https://dl.discordapp.net/apps/osx/${version}/Discord.dmg";
|
2024-03-27 18:02:14 +00:00
|
|
|
hash = "sha256-GlTebQ16sRgHdpB9+Jw7dn+KVZ6qIrAmWBSypTcoFmE=";
|
2022-11-05 12:51:32 +00:00
|
|
|
};
|
2022-06-27 20:59:02 +00:00
|
|
|
ptb = fetchurl {
|
|
|
|
url = "https://dl-ptb.discordapp.net/apps/osx/${version}/DiscordPTB.dmg";
|
2024-03-27 18:08:07 +00:00
|
|
|
hash = "sha256-X5bYO1D5eWTYh22v4R274OhjTsVv70XCyrMqeRlt0Bo=";
|
2022-01-14 17:30:55 +00:00
|
|
|
};
|
|
|
|
canary = fetchurl {
|
2022-06-27 20:59:02 +00:00
|
|
|
url = "https://dl-canary.discordapp.net/apps/osx/${version}/DiscordCanary.dmg";
|
2024-03-27 18:04:23 +00:00
|
|
|
hash = "sha256-psVm0eXDHVBGNb/R0kHbvz/4ilyIg4xlOj/CwkwlvgM=";
|
2022-01-14 17:30:55 +00:00
|
|
|
};
|
2023-05-02 10:45:21 +00:00
|
|
|
development = fetchurl {
|
|
|
|
url = "https://dl-development.discordapp.net/apps/osx/${version}/DiscordDevelopment.dmg";
|
2024-03-27 18:08:37 +00:00
|
|
|
hash = "sha256-nZV9LK3eGpXK/2wQKJBn3K2Ud6uBk8aammkeE00rWx0=";
|
2023-05-02 10:45:21 +00:00
|
|
|
};
|
2022-01-14 17:30:55 +00:00
|
|
|
};
|
2022-11-05 12:51:32 +00:00
|
|
|
aarch64-darwin = x86_64-darwin;
|
2019-06-19 05:39:15 +00:00
|
|
|
};
|
2024-04-05 02:30:31 +00:00
|
|
|
src = srcs.${stdenv.hostPlatform.system}.${branch} or (throw "${stdenv.hostPlatform.system} not supported on ${branch}");
|
2022-01-14 17:30:55 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "All-in-one cross-platform voice and text chat for gamers";
|
|
|
|
homepage = "https://discordapp.com/";
|
|
|
|
downloadPage = "https://discordapp.com/download";
|
2022-06-04 22:19:25 +00:00
|
|
|
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
|
2022-01-14 17:30:55 +00:00
|
|
|
license = licenses.unfree;
|
2023-05-08 06:44:09 +00:00
|
|
|
maintainers = with maintainers; [ MP2E Scrumplex artturin infinidoge jopejoe1 ];
|
2022-11-05 12:51:32 +00:00
|
|
|
platforms = [ "x86_64-linux" "x86_64-darwin" "aarch64-darwin" ];
|
2023-08-04 15:10:24 +00:00
|
|
|
mainProgram = "discord";
|
2022-01-14 17:30:55 +00:00
|
|
|
};
|
2022-06-27 20:59:02 +00:00
|
|
|
package =
|
|
|
|
if stdenv.isLinux
|
|
|
|
then ./linux.nix
|
|
|
|
else ./darwin.nix;
|
2022-06-23 19:34:12 +00:00
|
|
|
|
2022-07-01 21:55:49 +00:00
|
|
|
openasar = callPackage ./openasar.nix { };
|
2022-06-23 19:34:12 +00:00
|
|
|
|
2022-06-27 20:59:02 +00:00
|
|
|
packages = (
|
|
|
|
builtins.mapAttrs
|
|
|
|
(_: value:
|
|
|
|
callPackage package (value
|
|
|
|
// {
|
2022-10-24 18:43:06 +00:00
|
|
|
inherit src version openasar branch;
|
2022-06-27 20:59:02 +00:00
|
|
|
meta = meta // { mainProgram = value.binaryName; };
|
|
|
|
}))
|
|
|
|
{
|
|
|
|
stable = rec {
|
|
|
|
pname = "discord";
|
|
|
|
binaryName = "Discord";
|
|
|
|
desktopName = "Discord";
|
|
|
|
};
|
|
|
|
ptb = rec {
|
|
|
|
pname = "discord-ptb";
|
2022-09-18 10:41:15 +00:00
|
|
|
binaryName = if stdenv.isLinux then "DiscordPTB" else desktopName;
|
2022-06-27 20:59:02 +00:00
|
|
|
desktopName = "Discord PTB";
|
|
|
|
};
|
|
|
|
canary = rec {
|
|
|
|
pname = "discord-canary";
|
2022-09-18 10:41:15 +00:00
|
|
|
binaryName = if stdenv.isLinux then "DiscordCanary" else desktopName;
|
2022-06-27 20:59:02 +00:00
|
|
|
desktopName = "Discord Canary";
|
|
|
|
};
|
2023-05-02 10:45:21 +00:00
|
|
|
development = rec {
|
|
|
|
pname = "discord-development";
|
|
|
|
binaryName = if stdenv.isLinux then "DiscordDevelopment" else desktopName;
|
|
|
|
desktopName = "Discord Development";
|
|
|
|
};
|
2022-06-27 20:59:02 +00:00
|
|
|
}
|
2022-02-11 14:10:30 +00:00
|
|
|
);
|
2022-06-27 20:59:02 +00:00
|
|
|
in
|
|
|
|
packages.${branch}
|