maintainers/scripts/update-discord: improve
- add comment specifying file is generated - remove repetition of version number
This commit is contained in:
parent
d2d95670a5
commit
70167b64c5
@ -6,7 +6,7 @@ exec >${1:?usage: $0 <output-file>}
|
|||||||
|
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
{ branch ? "stable", pkgs }:
|
{ branch ? "stable", pkgs }:
|
||||||
|
# Generated by /maintainers/scripts/update-discord
|
||||||
let
|
let
|
||||||
inherit (pkgs) callPackage fetchurl;
|
inherit (pkgs) callPackage fetchurl;
|
||||||
in {
|
in {
|
||||||
@ -16,7 +16,7 @@ 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+')
|
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=${url##https://dl*.discordapp.net/apps/linux/}
|
||||||
version=${version%%/*.tar.gz}
|
version=${version%%/*.tar.gz}
|
||||||
echo " ${branch:-stable} = callPackage ./base.nix {"
|
echo " ${branch:-stable} = callPackage ./base.nix rec {"
|
||||||
echo " pname = \"discord${branch:+-}${branch}\";"
|
echo " pname = \"discord${branch:+-}${branch}\";"
|
||||||
case $branch in
|
case $branch in
|
||||||
"") suffix="" ;;
|
"") suffix="" ;;
|
||||||
@ -27,7 +27,7 @@ for branch in "" ptb canary; do
|
|||||||
echo " desktopName = \"Discord${suffix:+ }${suffix}\";"
|
echo " desktopName = \"Discord${suffix:+ }${suffix}\";"
|
||||||
echo " version = \"${version}\";"
|
echo " version = \"${version}\";"
|
||||||
echo " src = fetchurl {"
|
echo " src = fetchurl {"
|
||||||
echo " url = \"${url}\";"
|
echo " url = \"${url//${version}/\$\{version\}}\";"
|
||||||
echo " sha256 = \"$(nix-prefetch-url "$url")\";"
|
echo " sha256 = \"$(nix-prefetch-url "$url")\";"
|
||||||
echo " };"
|
echo " };"
|
||||||
echo " };"
|
echo " };"
|
||||||
|
@ -1,35 +1,35 @@
|
|||||||
{ branch ? "stable", pkgs }:
|
{ branch ? "stable", pkgs }:
|
||||||
|
# Generated by /maintainers/scripts/update-discord
|
||||||
let
|
let
|
||||||
inherit (pkgs) callPackage fetchurl;
|
inherit (pkgs) callPackage fetchurl;
|
||||||
in {
|
in {
|
||||||
stable = callPackage ./base.nix {
|
stable = callPackage ./base.nix rec {
|
||||||
pname = "discord";
|
pname = "discord";
|
||||||
binaryName = "Discord";
|
binaryName = "Discord";
|
||||||
desktopName = "Discord";
|
desktopName = "Discord";
|
||||||
version = "0.0.9";
|
version = "0.0.9";
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = "https://dl.discordapp.net/apps/linux/0.0.9/discord-0.0.9.tar.gz";
|
url = "https://dl.discordapp.net/apps/linux/${version}/discord-${version}.tar.gz";
|
||||||
sha256 = "1i0f8id10rh2fx381hx151qckvvh8hbznfsfav8w0dfbd1bransf";
|
sha256 = "1i0f8id10rh2fx381hx151qckvvh8hbznfsfav8w0dfbd1bransf";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
ptb = callPackage ./base.nix {
|
ptb = callPackage ./base.nix rec {
|
||||||
pname = "discord-ptb";
|
pname = "discord-ptb";
|
||||||
binaryName = "DiscordPTB";
|
binaryName = "DiscordPTB";
|
||||||
desktopName = "Discord PTB";
|
desktopName = "Discord PTB";
|
||||||
version = "0.0.16";
|
version = "0.0.16";
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = "https://dl-ptb.discordapp.net/apps/linux/0.0.16/discord-ptb-0.0.16.tar.gz";
|
url = "https://dl-ptb.discordapp.net/apps/linux/${version}/discord-ptb-${version}.tar.gz";
|
||||||
sha256 = "1ia94xvzygim9rx1sjnnss518ggw0i20mhp9pby33q70ha35n0aq";
|
sha256 = "1ia94xvzygim9rx1sjnnss518ggw0i20mhp9pby33q70ha35n0aq";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
canary = callPackage ./base.nix {
|
canary = callPackage ./base.nix rec {
|
||||||
pname = "discord-canary";
|
pname = "discord-canary";
|
||||||
binaryName = "DiscordCanary";
|
binaryName = "DiscordCanary";
|
||||||
desktopName = "Discord Canary";
|
desktopName = "Discord Canary";
|
||||||
version = "0.0.97";
|
version = "0.0.97";
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = "https://dl-canary.discordapp.net/apps/linux/0.0.97/discord-canary-0.0.97.tar.gz";
|
url = "https://dl-canary.discordapp.net/apps/linux/${version}/discord-canary-${version}.tar.gz";
|
||||||
sha256 = "17kwgk2kwrfqgjqmfv055gvlqq144gz7bywwrs6i2x7mimz4345x";
|
sha256 = "17kwgk2kwrfqgjqmfv055gvlqq144gz7bywwrs6i2x7mimz4345x";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user