diff options
author | Benjamin Hipple <bhipple@protonmail.com> | 2020-04-12 11:55:36 -0400 |
---|---|---|
committer | Benjamin Hipple <bhipple@protonmail.com> | 2020-04-12 11:55:36 -0400 |
commit | 58b812f7496dffb22a690267a3c74bbe5a12589d (patch) | |
tree | 58a8d4eb4dca611027bf3b8497e6b79f9a485569 /maintainers | |
parent | 17a1bf5dbd4439eb326fda62da8b782de2c138a5 (diff) |
discord-{ptb,canary}: update to latest versions and fixup updateScript
This commit:
- Moves the update script into the dir, out of the maintainers dir. This makes
it more discoverable in general. It can also be invoked from anywhere to write
to default.nix
- Swaps it to use the standardized `passthru.updateScript`. This means that
eventually bots like `nixpkgs-update` will be able to handle it.
- Runs the script to upgrade to the latest versions
See https://nixos.org/nixpkgs/manual/#ssec-stdenv-attributes
Diffstat (limited to 'maintainers')
-rwxr-xr-x | maintainers/scripts/update-discord | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/maintainers/scripts/update-discord b/maintainers/scripts/update-discord deleted file mode 100755 index b4c26b3bdefd..000000000000 --- a/maintainers/scripts/update-discord +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/env bash -# script to generate `pkgs/networking/instant-messengers/discord/default.nix` - -set -e -exec >${1:?usage: $0 <output-file>} - -cat <<EOF -{ branch ? "stable", pkgs }: -# Generated by /maintainers/scripts/update-discord -let - inherit (pkgs) callPackage fetchurl; -in { -EOF - -for branch in "" ptb canary; do - url=$(curl -sI "https://discordapp.com/api/download${branch:+/}${branch}?platform=linux&format=tar.gz" | grep -oP 'location: \K\S+') - version=${url##https://dl*.discordapp.net/apps/linux/} - version=${version%%/*.tar.gz} - echo " ${branch:-stable} = callPackage ./base.nix rec {" - echo " pname = \"discord${branch:+-}${branch}\";" - case $branch in - "") suffix="" ;; - ptb) suffix="PTB" ;; - canary) suffix="Canary" ;; - esac - echo " binaryName = \"Discord${suffix}\";" - echo " desktopName = \"Discord${suffix:+ }${suffix}\";" - echo " version = \"${version}\";" - echo " src = fetchurl {" - echo " url = \"${url//${version}/\$\{version\}}\";" - echo " sha256 = \"$(nix-prefetch-url "$url")\";" - echo " };" - echo " };" -done - -echo "}.\${branch}" |