aboutsummaryrefslogtreecommitdiffstats
path: root/modules/web/chromium/extensions
diff options
context:
space:
mode:
authorArpit Chakladar <arpitchakladar+git@gmail.com>2026-08-19 00:44:20 +0530
committerArpit Chakladar <arpitchakladar+git@gmail.com>2026-08-29 03:50:27 +0530
commita6fa6db17373eefaa2cffbfc4b882b145a733f9f (patch)
tree64d38fc6ddd354a8dde0b9b47ac6e21b2ef355fe /modules/web/chromium/extensions
parent2492b513c4189c31fb965af584a6bb0b73d01531 (diff)
downloadhome-manager-config-a6fa6db17373eefaa2cffbfc4b882b145a733f9f.tar.gz
home-manager-config-a6fa6db17373eefaa2cffbfc4b882b145a733f9f.zip
feat: removed the auto-update checking from the chromium extensions
Diffstat (limited to 'modules/web/chromium/extensions')
-rw-r--r--modules/web/chromium/extensions/aria2-explorer.nix18
-rw-r--r--modules/web/chromium/extensions/browserpass.nix18
-rw-r--r--modules/web/chromium/extensions/darkreader.nix18
-rw-r--r--modules/web/chromium/extensions/default.nix1
-rw-r--r--modules/web/chromium/extensions/lib.nix140
-rw-r--r--modules/web/chromium/extensions/searxng-home.nix22
-rw-r--r--modules/web/chromium/extensions/ublock-origin.nix18
-rw-r--r--modules/web/chromium/extensions/vimium.nix18
8 files changed, 18 insertions, 235 deletions
diff --git a/modules/web/chromium/extensions/aria2-explorer.nix b/modules/web/chromium/extensions/aria2-explorer.nix
index 694d74e..32fb9b9 100644
--- a/modules/web/chromium/extensions/aria2-explorer.nix
+++ b/modules/web/chromium/extensions/aria2-explorer.nix
@@ -7,25 +7,13 @@ let
owner = "alexhua";
repo = "Aria2-Explorer";
version = "2.8.2";
- checkedVersion = extLib.checkExtensionVersion {
- inherit
- pname
- owner
- repo
- version
- ;
- tagPrefix = "v";
- urlTemplate = "https://github.com/${owner}/${repo}/archive/refs/tags/v<version>.zip";
- };
in
{
- inherit pname;
- version = checkedVersion;
+ inherit pname version;
id = "hhndckjijagcbbljjhjcbnpjhamkkcjl";
drv = extLib.fetchUnpackedExtension {
- inherit pname;
- version = checkedVersion;
- url = "https://github.com/${owner}/${repo}/archive/refs/tags/v${checkedVersion}.zip";
+ inherit pname version;
+ url = "https://github.com/${owner}/${repo}/archive/refs/tags/v${version}.zip";
hash = "sha256-4+SkvgWrELcohpv724YEtvSQSDCmjphkk8bvYggxVag=";
extensionKey = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArOOLc1LawtEonls6j4P/KQyUAGO3KJcE9uAU9WV/tBIX6ulXivZypUAXC6Lokv56Bjnc08t/wUH8Xph0Gya4UzjSbZkdtR94yksY9mq5g/8df4p4v29SO+E6efQyXGyImEzFSHsNP4gu8akB5xT8O//51XRAXsMBVgUUTuUAlpnwd25Yy1tpQwqjbSV3gvAMo+a6+y0dBfXJ9fjwAYBwvx4cONSNjirIuyOG5r5FI5TaGMK+aV1xwNsDE59dyDkYL2f2mm1kN/2xMcayJrskVxtOcy18ijjXzyRJvNyhkLM2c5tEZHUkIlEgTjbJruF8EKrj2sCnodt1jknD0BSr1wIDAQAB";
};
diff --git a/modules/web/chromium/extensions/browserpass.nix b/modules/web/chromium/extensions/browserpass.nix
index 88ed7f4..c8b59a1 100644
--- a/modules/web/chromium/extensions/browserpass.nix
+++ b/modules/web/chromium/extensions/browserpass.nix
@@ -7,25 +7,13 @@ let
owner = "browserpass";
repo = "browserpass-extension";
version = "3.12.0";
- checkedVersion = extLib.checkExtensionVersion {
- inherit
- pname
- owner
- repo
- version
- ;
- tagPrefix = "";
- urlTemplate = "https://github.com/${owner}/${repo}/releases/download/<version>/browserpass-chromium-<version>.zip";
- };
in
{
- inherit pname;
- version = checkedVersion;
+ inherit pname version;
id = "jbaodoonnfhdccelcpnekimkijgdfjhl";
drv = extLib.fetchUnpackedExtension {
- inherit pname;
- version = checkedVersion;
- url = "https://github.com/${owner}/${repo}/releases/download/${checkedVersion}/browserpass-chromium-${checkedVersion}.zip";
+ inherit pname version;
+ url = "https://github.com/${owner}/${repo}/releases/download/${version}/browserpass-chromium-${version}.zip";
hash = "sha256-WBpPTtec7zJPWM1xNKVxWWW/sB1aIuPecp5fUTWRE8c=";
extensionKey = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAv8xL6YhF7YTUE57jhme0vyJi4FZGXDBLV93QYWv6yrYbmczkM4aEOp4FWm63NnkJ8aGZ/0uL0rHmB4qo36awso/1L9XGJaBbQAQuOv/uIPAE18STJ4EtXA1hYDMGbkkr4fZHYJTH3GmoeajZYfp/cu8qc0cK4P5FVq67qwYSD4uFQJRJKuX8jM4lzO8dLH/tJsN3KwlfeSA8xvS2jiIJHtCKc6XqMrOCCfSmI8uILfg06fv46VOoVDH91dlZguOYANAJDW69uCY9YcvyVEmmf6DUnvmkrziDtV2O4/Af6nt7R5JHOcVcqVScoXJG9sfd4KATMcgoZj3fy19+R/4GvwIDAQAB";
};
diff --git a/modules/web/chromium/extensions/darkreader.nix b/modules/web/chromium/extensions/darkreader.nix
index dababa2..94de411 100644
--- a/modules/web/chromium/extensions/darkreader.nix
+++ b/modules/web/chromium/extensions/darkreader.nix
@@ -7,25 +7,13 @@ let
owner = "darkreader";
repo = "darkreader";
version = "4.9.129";
- checkedVersion = extLib.checkExtensionVersion {
- inherit
- pname
- owner
- repo
- version
- ;
- tagPrefix = "v";
- urlTemplate = "https://github.com/${owner}/${repo}/releases/download/v<version>/darkreader-chrome.zip";
- };
in
{
- inherit pname;
- version = checkedVersion;
+ inherit pname version;
id = "nfkppknaehpcafkbgmhfhkpapflndfip";
drv = extLib.fetchUnpackedExtension {
- inherit pname;
- version = checkedVersion;
- url = "https://github.com/${owner}/${repo}/releases/download/v${checkedVersion}/darkreader-chrome.zip";
+ inherit pname version;
+ url = "https://github.com/${owner}/${repo}/releases/download/v${version}/darkreader-chrome.zip";
hash = "sha256-Yuhgoxp5MRgVMEEbOaQvRsVjYn/iaBhcHujipBX5rUE=";
extensionKey = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA8xN0p4CHkthdkB6imIb+8T2xsNSH9eeFAy7NhP3xAO1ML6FJyOFroabQIG6HcV7miXmJamY7zmE96QgEEvGqQ18+g+RsfvriJp0LRXi95TJBdCXoMiW348bWmue0Jk+/rhzWijMn/z/5fDnrZl0xjKU7MAXzW9dWfiTeIBc4wlk21zjGJxiG0uM1YAywe3jW8g0QCBga9iTaN67D+sBbBs4HmPa3xIbtPTAgqt1LDEk2T7IseoUia8MwxATWKWFegW6legMkPLVWH9jQ+x2ZbjtDP9GXk+1YqqWQUll1Xmal7C9ljeagkM5nhxgttAQoWBMPMJFwr7VN3AXtNXXPWQIDAQAB";
};
diff --git a/modules/web/chromium/extensions/default.nix b/modules/web/chromium/extensions/default.nix
index cfb3c54..78c0630 100644
--- a/modules/web/chromium/extensions/default.nix
+++ b/modules/web/chromium/extensions/default.nix
@@ -9,7 +9,6 @@ let
extLib = import ./lib.nix {
inherit lib pkgs config;
- checkForUpdates = cfg.checkForUpdates;
};
mkExtension = path: import path { inherit lib pkgs extLib; };
diff --git a/modules/web/chromium/extensions/lib.nix b/modules/web/chromium/extensions/lib.nix
index 2fdd3a8..6123b63 100644
--- a/modules/web/chromium/extensions/lib.nix
+++ b/modules/web/chromium/extensions/lib.nix
@@ -2,148 +2,8 @@
lib,
pkgs,
config,
- checkForUpdates ? true,
}:
-let
- # Fetch using the Releases API (Finds the latest official GitHub Release)
- fetchLatestGithubReleaseTag =
- { owner, repo }:
- let
- raw = builtins.fetchurl {
- url = "https://api.github.com/repos/${owner}/${repo}/releases/latest";
- name = "${repo}-latest-release.json";
- };
- json = builtins.fromJSON (builtins.readFile raw);
- in
- json.tag_name;
-
- # Fetch using the Tags API (Finds the newest tag matching a prefix/regex)
- fetchLatestGithubTag =
- {
- owner,
- repo,
- tagPrefix ? "",
- tagRegex ? null,
- }:
- let
- raw = builtins.fetchurl {
- url = "https://api.github.com/repos/${owner}/${repo}/tags";
- name = "${repo}-tags.json";
- };
- tags = builtins.fromJSON (builtins.readFile raw);
-
- isValidTag =
- t:
- let
- matchesPrefix = tagPrefix == "" || lib.hasPrefix tagPrefix t.name;
- matchesRegex = tagRegex == null || builtins.match tagRegex t.name != null;
- in
- matchesPrefix && matchesRegex;
-
- matchingTags = builtins.filter isValidTag tags;
- in
- if builtins.length matchingTags > 0 then
- (builtins.head matchingTags).name
- else
- throw "No tags found for ${owner}/${repo} matching prefix '${tagPrefix}' and regex '${toString tagRegex}'";
-
- # Internal helper to handle the version comparison and error message
- verifyAndThrow =
- {
- pname,
- version,
- latestTag,
- tagPrefix,
- urlTemplate,
- updateType,
- }:
- let
- latestVersion =
- if lib.hasPrefix tagPrefix latestTag then lib.removePrefix tagPrefix latestTag else latestTag;
- in
- if latestVersion != version then
- throw ''
- [${pname}] A newer ${updateType} is available upstream — refusing to build a stale extension.
-
- pinned version : ${version}
- latest version : ${latestVersion} (tag: ${latestTag})
-
- To upgrade, edit extensions/${pname}.nix:
- 1. Set version = "${latestVersion}";
- 2. Point the url at the new release asset:
- ${urlTemplate}
- 3. Set hash = lib.fakeHash;
- then re-run your switch — it'll fail with a hash mismatch showing
- the real sha256. Paste that in as the final hash.
- 4. Re-run once more. This check passes once pinned == latest.
-
- To skip this check for now (e.g. offline / pure eval), set:
- web.chromium.checkForUpdates = false;
- ''
- else
- version;
-in
{
- checkExtensionVersion =
- {
- pname,
- owner,
- repo,
- version,
- urlTemplate,
- tagPrefix ? "",
- }:
- if !checkForUpdates then
- version
- else
- let
- latestTag = fetchLatestGithubReleaseTag { inherit owner repo; };
- in
- verifyAndThrow {
- inherit
- pname
- version
- latestTag
- tagPrefix
- urlTemplate
- ;
- updateType = "release";
- };
-
- checkExtensionVersionByTag =
- {
- pname,
- owner,
- repo,
- version,
- urlTemplate,
- tagPrefix ? "",
- tagRegex ? null,
- }:
- if !checkForUpdates then
- version
- else
- let
- latestTag = fetchLatestGithubTag {
- inherit
- owner
- repo
- tagPrefix
- tagRegex
- ;
- };
- in
- verifyAndThrow {
- inherit
- pname
- version
- latestTag
- tagPrefix
- urlTemplate
- ;
- updateType = "tag";
- };
-
# EXTENSION BUILDERS
# Download and unpack a zip or crx file into an unpacked extension directory
fetchUnpackedExtension =
diff --git a/modules/web/chromium/extensions/searxng-home.nix b/modules/web/chromium/extensions/searxng-home.nix
index fcac55d..714ba90 100644
--- a/modules/web/chromium/extensions/searxng-home.nix
+++ b/modules/web/chromium/extensions/searxng-home.nix
@@ -6,30 +6,14 @@ let
pname = "searxng-home";
owner = "arpitchakladar";
repo = "searxng-home";
-
version = "0.2.0";
-
- checkedVersion = extLib.checkExtensionVersion {
- inherit
- pname
- owner
- repo
- version
- ;
- tagPrefix = "v";
- urlTemplate = "https://github.com/${owner}/${repo}/releases/download/v<version>/chrome-v<version>.zip";
- };
in
{
- inherit pname;
- version = checkedVersion;
-
+ inherit pname version;
id = "gmkjafoflhifgcnmpomcoakhahmepfkc";
-
drv = extLib.fetchUnpackedExtension {
- inherit pname;
- version = checkedVersion;
- url = "https://github.com/${owner}/${repo}/releases/download/v${checkedVersion}/chrome-v${checkedVersion}.zip";
+ inherit pname version;
+ url = "https://github.com/${owner}/${repo}/releases/download/v${version}/chrome-v${version}.zip";
hash = "sha256-fbXxtjTa8GKxylc5JS3GVj/oC+xCI5VJkE3bBpA2CbY=";
isCrx = false;
extensionKey = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA2cDXvyOi1QgsWlC8LnwyXIV7EZ6yWLKvKCNBn8DPD4DwJgw221wqo6R9p/qnsnqAuveZrV/ApRq6MdzAclkWTGKyCJCRdJGBG/XM3BVfMBkuLXaLrvpFf8p/mDcAP37yOh0Z45XMTr55Y9ifnNH6Wu+3zAaASJlkBuGZ5ygbcUYcomcKjs7qfqxqY8Qe9ovIuLOQely+X9i+Qa6bZ0GJUTgXiKHckgY/43l+H+gs9V91he8qaSubzWPqwbYk8aWhTmjQTeR0vfUP+1/XBESt4u4NGxHsuk+ZwwbL6ThYRbzgj/UbvVGVQsanhIwODdJte51XanEo475Woal31++uxwIDAQAB";
diff --git a/modules/web/chromium/extensions/ublock-origin.nix b/modules/web/chromium/extensions/ublock-origin.nix
index e15d103..a46a74d 100644
--- a/modules/web/chromium/extensions/ublock-origin.nix
+++ b/modules/web/chromium/extensions/ublock-origin.nix
@@ -7,25 +7,13 @@ let
owner = "gorhill";
repo = "uBlock";
version = "1.73.0";
- checkedVersion = extLib.checkExtensionVersion {
- inherit
- pname
- owner
- repo
- version
- ;
- tagPrefix = "";
- urlTemplate = "https://github.com/${owner}/${repo}/releases/download/<version>/uBlock0_<version>.chromium.zip";
- };
in
{
- inherit pname;
- version = checkedVersion;
+ inherit pname version;
id = "eahmphincfcmmpgkpobpneimcjndlcna";
drv = extLib.fetchUnpackedExtension {
- inherit pname;
- version = checkedVersion;
- url = "https://github.com/${owner}/${repo}/releases/download/${checkedVersion}/uBlock0_${checkedVersion}.chromium.zip";
+ inherit pname version;
+ url = "https://github.com/${owner}/${repo}/releases/download/${version}/uBlock0_${version}.chromium.zip";
hash = "sha256-IsYrwPNe0MXpXR/IMagprxmcfKb9tPhBvgNMJXGc6RE=";
extensionKey = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtXfkoFzWOh3Fet9x4L6WY1pw755kt7bFwqd/nmTm5Ptg7d40Qde0tTIhceCFVkwrWTQ3n2/WSpYXoU/UMgSW9anBzoUM0ZXanIdoeHwvL3eMNyx+iyvSrRxee26GwzbZ8J0UvH77KT3rW/iV5ejV4wTxTD3rFr0udkI5bbTPYpmGFOKPD8I3IB6BsoUTKW3XTSLM0fUYggdbDNwQGZvLYwqZzk/vWH/oifHR6CEvdFR51JAdf3tJQhttI6My49Vq6etCi9y5ZLXrMksxcEcIlQKaF2fdlfL1bYXRAVFDsieuAmu3gJPBj65PVJif5A7DfcH8zm8YGPwrJlTjaJQeDQIDAQAB";
};
diff --git a/modules/web/chromium/extensions/vimium.nix b/modules/web/chromium/extensions/vimium.nix
index 4c1511a..61b10c0 100644
--- a/modules/web/chromium/extensions/vimium.nix
+++ b/modules/web/chromium/extensions/vimium.nix
@@ -7,25 +7,13 @@ let
owner = "philc";
repo = "vimium";
version = "2.4.2";
- checkedVersion = extLib.checkExtensionVersionByTag {
- inherit
- pname
- owner
- repo
- version
- ;
- tagPrefix = "v";
- urlTemplate = "https://github.com/${owner}/${repo}/archive/refs/tags/v<version>.zip";
- };
in
{
- inherit pname;
- version = checkedVersion;
+ inherit pname version;
id = "ojbnfglfbelfbgfjlkehclgfkdkkjkdj";
drv = extLib.fetchUnpackedExtension {
- inherit pname;
- version = checkedVersion;
- url = "https://github.com/${owner}/${repo}/archive/refs/tags/v${checkedVersion}.zip";
+ inherit pname version;
+ url = "https://github.com/${owner}/${repo}/archive/refs/tags/v${version}.zip";
hash = "sha256-Q+Tus7nl7TiuVJ4hn8vYg9L2cC4NhqWSOr5WKD0RSq0=";
extensionKey = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqUw4MXlUYAqIQqJ1Gb/RH7RdgVjekKed1aoJS1OPM5C9EFfvVlj0/eIf8dVbCMKc7ThRYYJkZPqFNN38T0LtnBJbvdiJztL/nGueJT7GupXisIzJ9s17X+HpogODouDY7qHldQRw/7qnrBe0NeNxWVeUOH9PmHi8nBTZ3JRygS9svZ1BvY0ZkPZyNDTEsXCbb+fkSOOkjqDNqtt98eFJhPGZ0W+cn3KgTdr+rC0rqfacwfu41dpmQPEirOFtshs8DywoI+L66UtqVfwhBNdb3+JN7oeDs4HNFjCPbqOTSKKCng+nNndpIen2CKYUuYztvmrrRdQeEv5i3l7/MFrRXQIDAQAB";
};