about summary refs log tree commit diff
path: root/nixpkgs/maintainers/scripts/update-discord
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/maintainers/scripts/update-discord')
-rwxr-xr-xnixpkgs/maintainers/scripts/update-discord6
1 files changed, 3 insertions, 3 deletions
diff --git a/nixpkgs/maintainers/scripts/update-discord b/nixpkgs/maintainers/scripts/update-discord
index 23ec6e401be4..b4c26b3bdefd 100755
--- a/nixpkgs/maintainers/scripts/update-discord
+++ b/nixpkgs/maintainers/scripts/update-discord
@@ -6,7 +6,7 @@ exec >${1:?usage: $0 <output-file>}
 
 cat <<EOF
 { branch ? "stable", pkgs }:
-
+# Generated by /maintainers/scripts/update-discord
 let
   inherit (pkgs) callPackage fetchurl;
 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+')
     version=${url##https://dl*.discordapp.net/apps/linux/}
     version=${version%%/*.tar.gz}
-    echo "  ${branch:-stable} = callPackage ./base.nix {"
+    echo "  ${branch:-stable} = callPackage ./base.nix rec {"
     echo "    pname = \"discord${branch:+-}${branch}\";"
     case $branch in
         "") suffix="" ;;
@@ -27,7 +27,7 @@ for branch in "" ptb canary; do
     echo "    desktopName = \"Discord${suffix:+ }${suffix}\";"
     echo "    version = \"${version}\";"
     echo "    src = fetchurl {"
-    echo "      url = \"${url}\";"
+    echo "      url = \"${url//${version}/\$\{version\}}\";"
     echo "      sha256 = \"$(nix-prefetch-url "$url")\";"
     echo "    };"
     echo "  };"