Update spotify with overrideAttrs

This commit is contained in:
Dave Gallant
2021-03-13 23:55:24 -05:00
parent e2562217b3
commit 9bb8c1509b
2 changed files with 27 additions and 0 deletions

View File

@@ -176,6 +176,7 @@
# gnome
gnome3.gnome-tweaks
gnomeExtensions.appindicator
networkmanager-openvpn
# overlays
lpass

View File

@@ -5,4 +5,30 @@ final: prev: {
srv = prev.callPackage ./srv { };
vpngate = prev.callPackage ./vpngate { };
spotify-unwrapped =
# Get latest edge:
# curl -H 'X-Ubuntu-Series: 16' 'https://api.snapcraft.io/api/v1/snaps/details/spotify?channel=edge' | jq '.download_url,.version,.last_updated'
prev.spotify-unwrapped.overrideAttrs (oldAttrs: {
version = "1.1.52.687.gf5565fe5";
src = prev.fetchurl {
url =
"https://api.snapcraft.io/api/v1/snaps/download/pOBIoZ2LrCB3rDohMxoYGnbN14EHOgD7_44.snap";
sha512 =
"sha512-HIN8n25n4gSlsZQBGr9N+qaIxhN3xh8+2AttTzeAT1DQTVDIhAZ4UclGDURpYVpY1zuCJPvHG7knUkJ4hukXGQ==";
};
unpackPhase = ''
runHook preUnpack
unsquashfs "$src" '/usr/share/spotify' '/usr/bin/spotify' '/meta/snap.yaml'
cd squashfs-root
if ! grep -q '${final.spotify-unwrapped.version}' meta/snap.yaml; then
echo "Package version differs from version found in snap metadata:"
grep 'version: ' meta/snap.yaml
echo "While the nix package specifies: ${final.spotify-unwrapped.version}."
echo "You probably chose the wrong revision or forgot to update the nix version."
exit 1
fi
runHook postUnpack
'';
});
}