diff --git a/pkgs/applications/networking/instant-messengers/discord/base.nix b/pkgs/applications/networking/instant-messengers/discord/base.nix index a8b2b02f0bfd..2d67236c90eb 100644 --- a/pkgs/applications/networking/instant-messengers/discord/base.nix +++ b/pkgs/applications/networking/instant-messengers/discord/base.nix @@ -5,6 +5,7 @@ , libX11, libXScrnSaver, libXcomposite, libXcursor, libXdamage, libXext , libXfixes, libXi, libXrandr, libXrender, libXtst, libxcb, libxshmfence , mesa, nspr, nss, pango, systemd, libappindicator-gtk3, libdbusmenu +, writeScript, common-updater-scripts }: let @@ -71,7 +72,15 @@ in stdenv.mkDerivation rec { mimeType = "x-scheme-handler/discord"; }; - passthru.updateScript = ./update-discord.sh; + passthru.updateScript = writeScript "discord-update-script" '' + #!/usr/bin/env nix-shell + #!nix-shell -i bash -p curl gnugrep common-updater-scripts + set -eou pipefail; + url=$(curl -sI "https://discordapp.com/api/download/${builtins.replaceStrings ["discord-" "discord"] ["" "stable"] pname}?platform=linux&format=tar.gz" | grep -oP 'location: \K\S+') + version=''${url##https://dl*.discordapp.net/apps/linux/} + version=''${version%%/*.tar.gz} + update-source-version ${pname} "$version" --file=./pkgs/applications/networking/instant-messengers/discord/default.nix + ''; meta = with lib; { description = "All-in-one cross-platform voice and text chat for gamers"; diff --git a/pkgs/applications/networking/instant-messengers/discord/default.nix b/pkgs/applications/networking/instant-messengers/discord/default.nix index f7435aa3ae3b..d2d8c9a3ec5d 100644 --- a/pkgs/applications/networking/instant-messengers/discord/default.nix +++ b/pkgs/applications/networking/instant-messengers/discord/default.nix @@ -27,10 +27,10 @@ in { pname = "discord-canary"; binaryName = "DiscordCanary"; desktopName = "Discord Canary"; - version = "0.0.125"; + version = "0.0.126"; src = fetchurl { url = "https://dl-canary.discordapp.net/apps/linux/${version}/discord-canary-${version}.tar.gz"; - sha256 = "0ly5a6l7rvl54mc39xma14jrcrf11q3ndnkkr16by5hy3palmz9g"; + sha256 = "EraTDRKd6t0c9U68tSRdGkeB1hfqNS4KUewEXwkL8io="; }; }; }.${branch} diff --git a/pkgs/applications/networking/instant-messengers/discord/update-discord.sh b/pkgs/applications/networking/instant-messengers/discord/update-discord.sh deleted file mode 100755 index 34c1574c65aa..000000000000 --- a/pkgs/applications/networking/instant-messengers/discord/update-discord.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/env bash -# script to generate ./default.nix - -set -e -exec >"${BASH_SOURCE%/*}/default.nix" - -cat <