diff --git a/apps/update-sources/default.nix b/apps/update-sources/default.nix index 4eb86b07..8fbd9a22 100644 --- a/apps/update-sources/default.nix +++ b/apps/update-sources/default.nix @@ -1,6 +1,7 @@ { buildApp, callPackage, + nix-update, nodejs_latest, prefetch-npm-deps, ... @@ -10,6 +11,7 @@ buildApp { npmDepsHash = "sha256-vIhR/+Pgj35sv/ZX1iL+xWheu6w7vQeJy4OEfa8tXFw="; runtimeInputs = [ + nix-update nodejs_latest prefetch-npm-deps (callPackage ../../modules/docker/updateImage.nix {}) diff --git a/apps/update-sources/src/app.ts b/apps/update-sources/src/app.ts index 27378377..4140dc4a 100644 --- a/apps/update-sources/src/app.ts +++ b/apps/update-sources/src/app.ts @@ -6,9 +6,14 @@ import { parseArgs } from './lib'; import { updateDocker } from './docker'; import { updateFirefoxAddons } from '././firefox'; import { updateFlakeInputs } from './flake'; -import { updateCustomPackage, updateVuetorrent } from './misc'; import updateNodeModules from './node-modules'; +import { + runNixUpdate, + updateCustomPackage, + updateVuetorrent, +} from './misc'; + /* Constants */ const FLAKE = process.env.FLAKE; @@ -51,6 +56,10 @@ const main = async() => { console.log(await updateNodeModules()); } + if (args['h'] || args['homepage']) { + console.log(runNixUpdate('homepage')); + } + if (args['a'] || args['all']) { // Update this first because of nix run cmd const firefoxOutput = updateFirefoxAddons(); @@ -83,6 +92,7 @@ const main = async() => { 'scopedPackages.x86_64-linux.lovelace-components.custom-sidebar', )); console.log(updateCustomPackage('some-sass-language-server')); + console.log(runNixUpdate('homepage')); spawnSync('nixFastBuild', [], { diff --git a/apps/update-sources/src/misc.ts b/apps/update-sources/src/misc.ts index b8557317..7197c3aa 100644 --- a/apps/update-sources/src/misc.ts +++ b/apps/update-sources/src/misc.ts @@ -45,3 +45,9 @@ export const updateCustomPackage = (pkg: string) => spawnSync( [], { shell: true }, ).stderr.toString(); + +export const runNixUpdate = (attr: string, options: string[] = []) => spawnSync( + 'nix-update', + ['--flake', attr, ...options], + { shell: true, cwd: FLAKE }, +).stderr.toString();