3 , common-updater-scripts
15 downloadPageUrl = "https://download.electrum.org";
17 signingKeys = lib.lists.map fetchurl [
19 url = "https://github.com/spesmilo/electrum/raw/master/pubkeys/Emzy.asc";
20 hash = "sha256-QG0cM6AKlSKFacVlhcso/xvrooUdF7oqoppyezt0hjE=";
23 url = "https://github.com/spesmilo/electrum/raw/master/pubkeys/ThomasV.asc";
24 hash = "sha256-37ApVZlI+2EevxQIKXVKVpktt1Ls3UbWq4dfio2ORdo=";
27 url = "https://github.com/spesmilo/electrum/raw/master/pubkeys/sombernight_releasekey.asc";
28 hash = "sha256-GgdPJ9TB5hh5SPCcTZURfqXkrU4qwl0dCci52V/wpdQ=";
32 gpgImportPaths = lib.concatStringsSep " " signingKeys;
35 writeScript "update-electrum" ''
40 export PATH=${lib.makeBinPath [
41 common-updater-scripts
50 version=$(curl -L --list-only -- '${downloadPageUrl}' \
51 | grep -Po '<a href="\K([[:digit:]]+\.?)+' \
55 srcName=Electrum-$version
56 srcFile=$srcName.tar.gz
57 srcUrl="${downloadPageUrl}/$version/$srcFile"
61 [[ -e "$srcFile" ]] || curl -L -o "$srcFile" -- "$srcUrl"
62 [[ -e "$sigFile" ]] || curl -L -o "$sigFile" -- "$sigUrl"
64 export GNUPGHOME=$PWD/gnupg
65 mkdir -m 700 -p "$GNUPGHOME"
67 gpg --batch --import ${gpgImportPaths}
68 gpg --batch --verify "$sigFile" "$srcFile"
70 sha256=$(nix-prefetch-url --type sha256 "file://$PWD/$srcFile")
72 update-source-version electrum "$version" "$sha256"