parent
970a380805
commit
60bc645ae0
5 changed files with 73 additions and 33 deletions
apps/update
|
@ -2,6 +2,7 @@
|
|||
lib,
|
||||
system,
|
||||
buildNpmPackage,
|
||||
callPackage,
|
||||
makeWrapper,
|
||||
mozilla-addons-to-nix,
|
||||
nodejs_latest,
|
||||
|
@ -21,6 +22,7 @@ in
|
|||
npmDepsHash = "sha256-qpnQSJNl68LrsU8foJYxdBXpoFj7VKQahC9DFmleWTs=";
|
||||
|
||||
runtimeInputs = [
|
||||
(callPackage ../../modules/arion/updateImage.nix {})
|
||||
mozilla-addons-to-nix.packages.${system}.default
|
||||
];
|
||||
nativeBuildInputs = [makeWrapper];
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import { parseArgs } from './lib.ts';
|
||||
import { updateFirefoxAddons } from '././firefox.ts';
|
||||
import { updateDocker } from './misc.ts';
|
||||
|
||||
|
||||
const args = parseArgs();
|
||||
|
@ -7,3 +8,12 @@ const args = parseArgs();
|
|||
if (args['f'] || args['firefox']) {
|
||||
console.log(updateFirefoxAddons());
|
||||
}
|
||||
|
||||
if (args['d'] || args['docker']) {
|
||||
console.log(updateDocker());
|
||||
}
|
||||
|
||||
if (args['a'] || args['all']) {
|
||||
console.log(updateFirefoxAddons());
|
||||
console.log(updateDocker());
|
||||
}
|
||||
|
|
21
apps/update/src/misc.ts
Normal file
21
apps/update/src/misc.ts
Normal file
|
@ -0,0 +1,21 @@
|
|||
import { readdirSync } from 'node:fs';
|
||||
import { spawnSync } from 'node:child_process';
|
||||
|
||||
|
||||
/* Constants */
|
||||
const FLAKE = process.env.FLAKE;
|
||||
|
||||
export const updateDocker = () => {
|
||||
let updates = '';
|
||||
|
||||
const FILE = `${FLAKE}/devices/nos/modules/arion`;
|
||||
|
||||
readdirSync(FILE, { withFileTypes: true, recursive: true }).forEach((path) => {
|
||||
if (path.name === 'compose.nix') {
|
||||
updates += spawnSync('updateImages', [path.parentPath], { shell: true })
|
||||
.stdout.toString();
|
||||
}
|
||||
});
|
||||
|
||||
return updates;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue