firefox-extensions.privacypass-extension: init at 1.0.5 (DOESNT BUILD)

hopefully i'll come back to this when i have more time
This commit is contained in:
2025-04-24 16:03:50 +00:00
parent 641ac8bea7
commit 2f5ad8e7b0
2 changed files with 69 additions and 0 deletions

View File

@@ -140,6 +140,7 @@ let
i-still-dont-care-about-cookies = callPackage ./i-still-dont-care-about-cookies { };
# open-in-mpv = callPackage ./open-in-mpv { };
passff = callPackage ./passff { };
privacypass-extension = callPackage ./privacypass-extension { };
sidebery = callPackage ./sidebery { };
# ether-metamask = fetchVersionedAddon rec {

View File

@@ -0,0 +1,68 @@
# N.B.: this package relies on a rust-based library,
# ordinarily built via git submodule + cargo invocation.
# TODO: build that library using Nix; otherwise, it fails to build with raw cargo
# due to a missing cargo vendor pack.
{
cargo,
fetchFromGitHub,
gitUpdater,
jq,
stdenv,
wasm-pack,
zip,
}:
stdenv.mkDerivation rec {
pname = "privacypass-extension";
version = "1.0.5";
src = fetchFromGitHub {
owner = "kagisearch";
repo = "privacypass-extension";
# deepClone = true;
fetchSubmodules = true;
rev = "v${version}";
# hash = "sha256-5ngpq0sW+Eu/yoBBwge+6U1SpAMyNlBnNfb9cSrzqQ0=";
# hash = "sha256-Cho2HU6GwgTQDWMSxmwDZm3oC3tiDNzvFgsRLtYGwUU=";
hash = "sha256-FtXX88WUWJ7AYnECsrEJB6+RqhvO3IxdYLS25f79yGc=";
};
nativeBuildInputs = [
cargo
jq
wasm-pack
zip
];
buildPhase = ''
runHook preBuild
sh ./make.sh 1
runHook postBuild
'';
installPhase = ''
runHook preInstall
install build/firefox/kagi_privacypass_firefox_1.0.5.xpi $out
runHook postInstall
'';
checkPhase = ''
runHook preCheck
# make sure we packaged all the resources needed at runtime
# from manifest.json's `resources` field:
test -f scripts/kagippjs/kagippjs.js
test -f scripts/kagippjs/kagippjs_bg.wasm
runHook postCheck
'';
doCheck = true;
passthru = {
extid = "privacypass@kagi.com";
updateScript = gitUpdater {};
};
}