firefox-extensions: factor out the github addon fetcher
This commit is contained in:
@@ -81,6 +81,20 @@ let
|
|||||||
# extid can be found by unar'ing the above xpi, and copying browser_specific_settings.gecko.id field
|
# extid can be found by unar'ing the above xpi, and copying browser_specific_settings.gecko.id field
|
||||||
passthru = { inherit extid; };
|
passthru = { inherit extid; };
|
||||||
};
|
};
|
||||||
|
fetchVersionedAddon = { version, url, hash, extid, pname ? extid }: stdenv.mkDerivation {
|
||||||
|
inherit pname version;
|
||||||
|
src = fetchurl {
|
||||||
|
inherit url hash;
|
||||||
|
};
|
||||||
|
dontUnpack = true;
|
||||||
|
installPhase = ''
|
||||||
|
cp $src $out
|
||||||
|
'';
|
||||||
|
|
||||||
|
passthru.updateScript = nix-update-script { };
|
||||||
|
passthru.extid = extid;
|
||||||
|
};
|
||||||
|
|
||||||
in lib.makeScope newScope (self: with self; {
|
in lib.makeScope newScope (self: with self; {
|
||||||
unwrapped = lib.recurseIntoAttrs {
|
unwrapped = lib.recurseIntoAttrs {
|
||||||
# get names from:
|
# get names from:
|
||||||
@@ -101,21 +115,12 @@ in lib.makeScope newScope (self: with self; {
|
|||||||
ublock-origin = fetchAddon "ublock-origin" "uBlock0@raymondhill.net"
|
ublock-origin = fetchAddon "ublock-origin" "uBlock0@raymondhill.net"
|
||||||
"sha256-OTJQbOTfMG5Np1J9k9YP4EIc8VBFwvTqc1idmgkCJms=";
|
"sha256-OTJQbOTfMG5Np1J9k9YP4EIc8VBFwvTqc1idmgkCJms=";
|
||||||
|
|
||||||
sponsorblock = stdenv.mkDerivation rec {
|
sponsorblock = fetchVersionedAddon rec {
|
||||||
|
extid = "sponsorBlocker@ajay.app";
|
||||||
pname = "sponsorblock";
|
pname = "sponsorblock";
|
||||||
version = "5.4.21";
|
version = "5.4.21";
|
||||||
src = fetchurl {
|
url = "https://github.com/ajayyy/SponsorBlock/releases/download/${version}/FirefoxSignedInstaller.xpi";
|
||||||
url = "https://github.com/ajayyy/SponsorBlock/releases/download/${version}/FirefoxSignedInstaller.xpi";
|
hash = "sha256-mfCHD46FgmCQ8ugg58ML19zIllBQEJthfheTrEObs7M=";
|
||||||
hash = "sha256-mfCHD46FgmCQ8ugg58ML19zIllBQEJthfheTrEObs7M=";
|
|
||||||
};
|
|
||||||
|
|
||||||
dontUnpack = true;
|
|
||||||
installPhase = ''
|
|
||||||
cp $src $out
|
|
||||||
'';
|
|
||||||
|
|
||||||
passthru.updateScript = nix-update-script { };
|
|
||||||
passthru.extid = "sponsorBlocker@ajay.app";
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user