From 68e3bc932fe25589a6baf7168b74a6949c27c5fa Mon Sep 17 00:00:00 2001 From: Colin Date: Fri, 22 Sep 2023 10:11:44 +0000 Subject: [PATCH] bypass-paywalls-clean: 3.2.5.0 -> 3.3.4.0; lay the foundation for updateScripts in this repo note that the hash produced by the updateScript wasn't actually correct (failed once i attempted to build it). hmm. --- default.nix | 9 +++++++++ flake.nix | 15 +++++++++++++++ .../bypass-paywalls-clean/default.nix | 8 ++++++-- 3 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 default.nix diff --git a/default.nix b/default.nix new file mode 100644 index 00000000..d15fd101 --- /dev/null +++ b/default.nix @@ -0,0 +1,9 @@ +# limited, non-flake interface to this repo. +# this file exposes the same view into `pkgs` which the flake would see when evaluated. +# +# the primary purpose of this file is so i can run `updateScript`s which expect +# the root to be `default.nix` +{ pkgs ? import {} }: +pkgs.appendOverlays [ + (import ./overlays/all.nix) +] diff --git a/flake.nix b/flake.nix index 990309e8..55a83165 100644 --- a/flake.nix +++ b/flake.nix @@ -276,6 +276,21 @@ program = "${pkgs.feeds.updateScript}"; }; + update-bpc = { + # proof-of-concept updater like in nixpkgs + # TODO: extend this to update all my packages + type = "app"; + program = let + pkg = pkgs.firefox-extensions.unwrapped.bypass-paywalls-clean; + in builtins.toString (pkgs.writeShellScript "update-bpc" '' + export UPDATE_NIX_NAME=${pkg.name} + export UPDATE_NIX_PNAME=${pkg.pname} + export UPDATE_NIX_OLD_VERSION=${pkg.version} + export UPDATE_NIX_ATTR_PATH=firefox-extensions.unwrapped.bypass-paywalls-clean + ${pkgs.lib.escapeShellArgs pkg.updateScript.command} + ''); + }; + init-feed = { type = "app"; program = "${pkgs.feeds.initFeedScript}"; diff --git a/pkgs/additional/firefox-extensions/bypass-paywalls-clean/default.nix b/pkgs/additional/firefox-extensions/bypass-paywalls-clean/default.nix index 0eeca60d..8035545a 100644 --- a/pkgs/additional/firefox-extensions/bypass-paywalls-clean/default.nix +++ b/pkgs/additional/firefox-extensions/bypass-paywalls-clean/default.nix @@ -1,17 +1,18 @@ { lib , fetchFromGitLab +, gitUpdater , stdenv , zip }: stdenv.mkDerivation rec { pname = "bypass-paywalls-clean"; - version = "3.2.5.0"; + version = "3.3.4.0"; src = fetchFromGitLab { owner = "magnolia1234"; repo = "bypass-paywalls-firefox-clean"; rev = "v${version}"; - hash = "sha256-FkAqzJisPdBiElX9ceQS3zfg8zwrsozOquHDagiRKiE="; + hash = "sha256-tgtdtTRLFgkJ7KuwLbLqrrImujKeeSWGEXc274G/YN0="; }; patches = [ @@ -28,6 +29,9 @@ stdenv.mkDerivation rec { passthru = { extid = "magnolia@12.34"; + updateScript = gitUpdater { + rev-prefix = "v"; + }; }; meta = {