3 , common-updater-scripts
16 downloadPageUrl = "https://download.electrum.org";
18 signingKeys = ["6694 D8DE 7BE8 EE56 31BE D950 2BD5 824B 7F94 70E6"];
21 writeScript "update-electrum" ''
26 export PATH=${makeBinPath [
27 common-updater-scripts
36 version=$(curl -L --list-only -- '${downloadPageUrl}' \
37 | grep -Po '<a href="\K([[:digit:]]+\.?)+' \
41 srcName=Electrum-$version
42 srcFile=$srcName.tar.gz
43 srcUrl="${downloadPageUrl}/$version/$srcFile"
47 [[ -e "$srcFile" ]] || curl -L -o "$srcFile" -- "$srcUrl"
48 [[ -e "$sigFile" ]] || curl -L -o "$sigFile" -- "$sigUrl"
50 export GNUPGHOME=$PWD/gnupg
51 mkdir -m 700 -p "$GNUPGHOME"
53 gpg --batch --recv-keys ${concatStringsSep " " (map (x: "'${x}'") signingKeys)}
54 gpg --batch --verify "$sigFile" "$srcFile"
56 sha256=$(nix-prefetch-url --type sha256 "file://$PWD/$srcFile")
58 update-source-version electrum "$version" "$sha256"