diff options
author | Moritz Hedtke <13287984+mohe2015@users.noreply.github.com> | 2021-07-15 22:14:41 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-15 22:14:41 +0200 |
commit | 8e170dc44a9d782c6991c7f9386187be3d5ffbbc (patch) | |
tree | 8ecc9d29be9a4311bdd234df9c4504fd68b1c35a /pkgs/applications/networking/instant-messengers/discord/base.nix | |
parent | dadf56e3a6835f2cc8047e4ae8569b0343d53892 (diff) |
discord: fix updater script (#128633)
Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
Diffstat (limited to 'pkgs/applications/networking/instant-messengers/discord/base.nix')
-rw-r--r-- | pkgs/applications/networking/instant-messengers/discord/base.nix | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/pkgs/applications/networking/instant-messengers/discord/base.nix b/pkgs/applications/networking/instant-messengers/discord/base.nix index a8b2b02f0bfde..2d67236c90eb9 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"; |