From cae6ef50d18538d7d41f86e6559b1f13c791352d Mon Sep 17 00:00:00 2001 From: punkfairie Date: Sat, 11 Jan 2025 20:18:09 -0800 Subject: [PATCH] refactor(overlay): Move addon code to seperate file to allow regeneration Also cleaned up the arguments a bit. --- overlays/firefox-addons/addons.json | 3 + overlays/firefox-addons/addons.nix | 136 ++++++++++++++++++++++++++++ overlays/firefox-addons/default.nix | 120 +----------------------- 3 files changed, 141 insertions(+), 118 deletions(-) create mode 100644 overlays/firefox-addons/addons.nix diff --git a/overlays/firefox-addons/addons.json b/overlays/firefox-addons/addons.json index 6adbf73..d940d1e 100644 --- a/overlays/firefox-addons/addons.json +++ b/overlays/firefox-addons/addons.json @@ -38,5 +38,8 @@ "tag": "predefined", "shortName": "mit" } + }, + { + "slug": "rose-pine-color-port" } ] diff --git a/overlays/firefox-addons/addons.nix b/overlays/firefox-addons/addons.nix new file mode 100644 index 0000000..3a6dd73 --- /dev/null +++ b/overlays/firefox-addons/addons.nix @@ -0,0 +1,136 @@ +{ + buildFirefoxXpiAddon, + lib, +}: { + "axe-devtools" = buildFirefoxXpiAddon { + pname = "axe-devtools"; + version = "4.94.1"; + addonId = "@axe-firefox-devtools"; + url = "https://addons.mozilla.org/firefox/downloads/file/4374713/axe_devtools-4.94.1.xpi"; + sha256 = "92e8152da2b07303b1efd87c5a5b45e3ec847bf4760016809b5f5714a478f50b"; + meta = with lib; { + homepage = "https://www.deque.com/"; + description = "Add accessibility auditing to the Firefox Developer Tools"; + license = { + shortName = "axe-devtools"; + fullName = "Custom License for axe DevTools"; + url = "https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/license/"; + free = false; + }; + mozPermissions = [ + "tabs" + "storage" + "activeTab" + "devtools" + "" + ]; + platforms = platforms.all; + }; + }; + "clockwork-dev-tools" = buildFirefoxXpiAddon { + pname = "clockwork-dev-tools"; + version = "5.3.1"; + addonId = "{c9b5d073-47b4-40df-b9b9-d80601a5ab76}"; + url = "https://addons.mozilla.org/firefox/downloads/file/4391092/clockwork_dev_tools-5.3.1.xpi"; + sha256 = "56b372b0e3fe1c8aa6ec0e82e882ab7b922e1bdd04f4435a1c7812ae674776f0"; + meta = with lib; { + homepage = "https://underground.works/clockwork"; + description = "php dev tools integrated to your browser"; + license = licenses.mit; + mozPermissions = [ + "cookies" + "storage" + "tabs" + "webNavigation" + "webRequest" + "http://*/" + "https://*/" + "devtools" + ]; + platforms = platforms.all; + }; + }; + "medium-parser" = buildFirefoxXpiAddon { + pname = "medium-parser"; + version = "1.5.5"; + addonId = "medium-parser@example.com"; + url = "https://addons.mozilla.org/firefox/downloads/file/4283826/medium_parser-1.5.5.xpi"; + sha256 = "4aa61952269c2eb48c53d8355f94c17abc27d358c20738970d96d8d9f14b07b6"; + meta = with lib; { + homepage = "https://github.com/Xatta-Trone/medium-parser-extension"; + description = "Unlocks the whole medium article on the go."; + license = licenses.mpl20; + mozPermissions = ["storage" "contextMenus" ""]; + platforms = platforms.all; + }; + }; + "readwise" = buildFirefoxXpiAddon { + pname = "readwise"; + version = "2.8.0"; + addonId = "{f7619bc3-ed22-44a3-83ad-e79a78416737}"; + url = "https://addons.mozilla.org/firefox/downloads/file/3732256/readwise-2.8.0.xpi"; + sha256 = "a1bb894e3af1ed0d80c80af6bdafca930ecd0fbc95e409d20f74943b7076d106"; + meta = with lib; { + homepage = "https://readwise.io"; + description = "Don't let your kindle highlights disappear. Sync them with Readwise and then review them daily."; + license = { + shortName = "allrightsreserved"; + fullName = "All Rights Reserved"; + url = "https://en.wikipedia.org/w/index.php?title=All_rights_reserved&oldid=1101263186"; + free = false; + }; + mozPermissions = [ + "notifications" + "cookies" + "storage" + "alarms" + "contextMenus" + "*://read.amazon.com/*" + "*://*.readwise.io/*" + ]; + platforms = platforms.all; + }; + }; + "readwise-highlighter" = buildFirefoxXpiAddon { + pname = "readwise-highlighter"; + version = "0.15.23"; + addonId = "team@readwise.io"; + url = "https://addons.mozilla.org/firefox/downloads/file/4222692/readwise_highlighter-0.15.23.xpi"; + sha256 = "260eb678acbbb37b5bb34211ff31ce4b32e94158fefb04d46323d4e0c5018a94"; + meta = with lib; { + homepage = "https://read.readwise.io"; + description = "The Readwise Highlighter is the official browser extension made by and maintained by the Readwise team that saves articles to your Reader account and enables you to optionally highlight the open web."; + license = { + shortName = "allrightsreserved"; + fullName = "All Rights Reserved"; + url = "https://en.wikipedia.org/w/index.php?title=All_rights_reserved&oldid=1101263186"; + free = false; + }; + mozPermissions = [ + "" + "activeTab" + "background" + "contextMenus" + "notifications" + "storage" + "tabs" + "unlimitedStorage" + ]; + platforms = platforms.all; + }; + }; + "rose-pine-color-port" = buildFirefoxXpiAddon { + pname = "rose-pine-color-port"; + version = "1.1"; + addonId = "{3c9f3c5d-ec80-455f-bd7c-4f2b51a1a4d9}"; + url = "https://addons.mozilla.org/firefox/downloads/file/4219203/rose_pine_color_port-1.1.xpi"; + sha256 = "d8304fdc0179a22b3769279c176e4973c1078f5be08dfdcfbabb50129cac9641"; + meta = with lib; { + description = "Port of Rose Pine from Firefox Color"; + license = licenses.cc-by-30; + mozPermissions = []; + platforms = platforms.all; + }; + }; +} + diff --git a/overlays/firefox-addons/default.nix b/overlays/firefox-addons/default.nix index 6f1803a..710c4b7 100644 --- a/overlays/firefox-addons/default.nix +++ b/overlays/firefox-addons/default.nix @@ -37,124 +37,8 @@ in marleyos = prev.marleyos // { - firefox-addons = { - "axe-devtools" = buildFirefoxXpiAddon { - pname = "axe-devtools"; - version = "4.94.1"; - addonId = "@axe-firefox-devtools"; - url = "https://addons.mozilla.org/firefox/downloads/file/4374713/axe_devtools-4.94.1.xpi"; - sha256 = "92e8152da2b07303b1efd87c5a5b45e3ec847bf4760016809b5f5714a478f50b"; - meta = with lib; { - homepage = "https://www.deque.com/"; - description = "Add accessibility auditing to the Firefox Developer Tools"; - license = { - shortName = "axe-devtools"; - fullName = "Custom License for axe DevTools"; - url = "https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/license/"; - free = false; - }; - mozPermissions = [ - "tabs" - "storage" - "activeTab" - "devtools" - "" - ]; - platforms = platforms.all; - }; - }; - "clockwork-dev-tools" = buildFirefoxXpiAddon { - pname = "clockwork-dev-tools"; - version = "5.3.1"; - addonId = "{c9b5d073-47b4-40df-b9b9-d80601a5ab76}"; - url = "https://addons.mozilla.org/firefox/downloads/file/4391092/clockwork_dev_tools-5.3.1.xpi"; - sha256 = "56b372b0e3fe1c8aa6ec0e82e882ab7b922e1bdd04f4435a1c7812ae674776f0"; - meta = with lib; { - homepage = "https://underground.works/clockwork"; - description = "php dev tools integrated to your browser"; - license = licenses.mit; - mozPermissions = [ - "cookies" - "storage" - "tabs" - "webNavigation" - "webRequest" - "http://*/" - "https://*/" - "devtools" - ]; - platforms = platforms.all; - }; - }; - "medium-parser" = buildFirefoxXpiAddon { - pname = "medium-parser"; - version = "1.5.5"; - addonId = "medium-parser@example.com"; - url = "https://addons.mozilla.org/firefox/downloads/file/4283826/medium_parser-1.5.5.xpi"; - sha256 = "4aa61952269c2eb48c53d8355f94c17abc27d358c20738970d96d8d9f14b07b6"; - meta = with lib; { - homepage = "https://github.com/Xatta-Trone/medium-parser-extension"; - description = "Unlocks the whole medium article on the go."; - license = licenses.mpl20; - mozPermissions = ["storage" "contextMenus" ""]; - platforms = platforms.all; - }; - }; - "readwise" = buildFirefoxXpiAddon { - pname = "readwise"; - version = "2.8.0"; - addonId = "{f7619bc3-ed22-44a3-83ad-e79a78416737}"; - url = "https://addons.mozilla.org/firefox/downloads/file/3732256/readwise-2.8.0.xpi"; - sha256 = "a1bb894e3af1ed0d80c80af6bdafca930ecd0fbc95e409d20f74943b7076d106"; - meta = with lib; { - homepage = "https://readwise.io"; - description = "Don't let your kindle highlights disappear. Sync them with Readwise and then review them daily."; - license = { - shortName = "allrightsreserved"; - fullName = "All Rights Reserved"; - url = "https://en.wikipedia.org/w/index.php?title=All_rights_reserved&oldid=1101263186"; - free = false; - }; - mozPermissions = [ - "notifications" - "cookies" - "storage" - "alarms" - "contextMenus" - "*://read.amazon.com/*" - "*://*.readwise.io/*" - ]; - platforms = platforms.all; - }; - }; - "readwise-highlighter" = buildFirefoxXpiAddon { - pname = "readwise-highlighter"; - version = "0.15.23"; - addonId = "team@readwise.io"; - url = "https://addons.mozilla.org/firefox/downloads/file/4222692/readwise_highlighter-0.15.23.xpi"; - sha256 = "260eb678acbbb37b5bb34211ff31ce4b32e94158fefb04d46323d4e0c5018a94"; - meta = with lib; { - homepage = "https://read.readwise.io"; - description = "The Readwise Highlighter is the official browser extension made by and maintained by the Readwise team that saves articles to your Reader account and enables you to optionally highlight the open web."; - license = { - shortName = "allrightsreserved"; - fullName = "All Rights Reserved"; - url = "https://en.wikipedia.org/w/index.php?title=All_rights_reserved&oldid=1101263186"; - free = false; - }; - mozPermissions = [ - "" - "activeTab" - "background" - "contextMenus" - "notifications" - "storage" - "tabs" - "unlimitedStorage" - ]; - platforms = platforms.all; - }; - }; + firefox-addons = import ./addons.nix { + inherit buildFirefoxXpiAddon lib; }; }; }