From 6f8e3928171724134988c3fdccc68864aa5bc531 Mon Sep 17 00:00:00 2001 From: matt1432 Date: Wed, 13 Nov 2024 15:27:28 -0500 Subject: [PATCH] refactor(upScript): move ffz to mozilla-addons-to-nix --- apps/update/src/docker.ts | 20 +++++++++---------- apps/update/src/firefox.ts | 15 -------------- legacyPackages/firefox-addons/addons.json | 3 +++ .../generated-firefox-addons.nix | 19 +++++++++++++++--- 4 files changed, 29 insertions(+), 28 deletions(-) diff --git a/apps/update/src/docker.ts b/apps/update/src/docker.ts index 42655461..c58bfbdf 100644 --- a/apps/update/src/docker.ts +++ b/apps/update/src/docker.ts @@ -5,17 +5,17 @@ import { spawnSync } from 'node:child_process'; /* Constants */ const FLAKE = process.env.FLAKE; +const updateImages = (imagePath: string): string | undefined => { + console.log(`Updating ${imagePath.split('/').at(-1)} images`); + + const out = spawnSync('updateImages', [imagePath], { shell: true }).stdout.toString(); + + if (!out.startsWith('# Locked')) { + return out; + } +}; + export const updateDocker = () => { - const updateImages = (imagePath: string): string | undefined => { - console.log(`Updating ${imagePath.split('/').at(-1)} images`); - - const out = spawnSync('updateImages', [imagePath], { shell: true }).stdout.toString(); - - if (!out.startsWith('# Locked')) { - return out; - } - }; - let updates = ''; updates += updateImages(`${FLAKE}/devices/nos/modules/jellyfin`) ?? ''; diff --git a/apps/update/src/firefox.ts b/apps/update/src/firefox.ts index f1582f41..04c82afc 100644 --- a/apps/update/src/firefox.ts +++ b/apps/update/src/firefox.ts @@ -1,26 +1,11 @@ import { spawnSync } from 'node:child_process'; import { readFileSync } from 'node:fs'; -import { parseFetchurl } from './lib.ts'; /* Constants */ const FLAKE = process.env.FLAKE; - -const updateFFZ = () => { - const FILE = `${FLAKE}/legacyPackages/firefox-addons/default.nix`; - const URL = 'https://cdn.frankerfacez.com/script/frankerfacez-4.0-an+fx.xpi'; - - const HASH = parseFetchurl(URL); - - spawnSync('sed', ['-i', `'s,url = .*,url = \"${URL}\";,'`, FILE], { shell: true }); - spawnSync('sed', ['-i', `'s,sha256 = .*,sha256 = \"${HASH}\";,'`, FILE], { shell: true }); -}; - export const updateFirefoxAddons = () => { - console.log('Updating FFZ addon'); - updateFFZ(); - console.log('Updating firefox addons using mozilla-addons-to-nix'); const DIR = `${FLAKE}/legacyPackages/firefox-addons`; diff --git a/legacyPackages/firefox-addons/addons.json b/legacyPackages/firefox-addons/addons.json index 731b65fd..5a067775 100644 --- a/legacyPackages/firefox-addons/addons.json +++ b/legacyPackages/firefox-addons/addons.json @@ -15,6 +15,9 @@ { "slug": "floccus" }, + { + "slug": "frankerfacez" + }, { "slug": "google-container" }, diff --git a/legacyPackages/firefox-addons/generated-firefox-addons.nix b/legacyPackages/firefox-addons/generated-firefox-addons.nix index 8d34d966..d6e7d2b6 100644 --- a/legacyPackages/firefox-addons/generated-firefox-addons.nix +++ b/legacyPackages/firefox-addons/generated-firefox-addons.nix @@ -123,6 +123,19 @@ platforms = platforms.all; }; }; + "frankerfacez" = buildFirefoxXpiAddon { + pname = "frankerfacez"; + version = "4.75.5.7"; + addonId = "frankerfacez@frankerfacez.com"; + url = "https://addons.mozilla.org/firefox/downloads/file/4377242/frankerfacez-4.75.5.7.xpi"; + sha256 = "e2edce704c662a7437edf5707777b72848fb857961587d4594d3d390a4bae9c1"; + meta = with lib; { + homepage = "https://www.frankerfacez.com"; + description = "The Twitch Enhancement Suite - Get custom emotes and tons of new features you'll never want to go without."; + mozPermissions = ["*://*.twitch.tv/*"]; + platforms = platforms.all; + }; + }; "google-container" = buildFirefoxXpiAddon { pname = "google-container"; version = "1.5.4"; @@ -314,10 +327,10 @@ }; "ublock-origin" = buildFirefoxXpiAddon { pname = "ublock-origin"; - version = "1.60.0"; + version = "1.61.0"; addonId = "uBlock0@raymondhill.net"; - url = "https://addons.mozilla.org/firefox/downloads/file/4359936/ublock_origin-1.60.0.xpi"; - sha256 = "e2cda9b2a1b0a7f6e5ef0da9f87f28df52f8560587ba2e51a3003121cfb81600"; + url = "https://addons.mozilla.org/firefox/downloads/file/4382536/ublock_origin-1.61.0.xpi"; + sha256 = "e6fd55b799a568c66c10892a8f22428e6773fe16d7466ce9dee2952f224b203d"; meta = with lib; { homepage = "https://github.com/gorhill/uBlock#ublock-origin"; description = "Finally, an efficient wide-spectrum content blocker. Easy on CPU and memory.";