refactor(upScript): move ffz to mozilla-addons-to-nix

This commit is contained in:
matt1432 2024-11-13 15:27:28 -05:00
parent df50815aba
commit 6f8e392817
4 changed files with 29 additions and 28 deletions
apps/update/src

View file

@ -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`) ?? '';

View file

@ -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`;