diff --git a/apps/update-sources/src/app.ts b/apps/update-sources/src/app.ts index 6a68533b..40a7cf7a 100644 --- a/apps/update-sources/src/app.ts +++ b/apps/update-sources/src/app.ts @@ -11,7 +11,6 @@ import updateNodeModules from './node-modules'; import { runNixUpdate, updateCaddyPlugins, - updateCustomPackage, updateVuetorrent, } from './misc'; @@ -28,9 +27,7 @@ const args = parseArgs(); const main = async() => { if (args['c'] || args['custom-sidebar']) { - console.log(updateCustomPackage( - 'scopedPackages.x86_64-linux.lovelace-components.custom-sidebar', - )); + console.log(runNixUpdate('scopedPackages', 'lovelace-components', 'custom-sidebar')); } if (args['cp'] || args['caddy-plugins']) { @@ -74,7 +71,7 @@ const main = async() => { } if (args['s'] || args['some-sass-language-server']) { - console.log(updateCustomPackage('some-sass-language-server')); + console.log(runNixUpdate('some-sass-language-server')); } if (args['t'] || args['trash-d']) { @@ -117,12 +114,6 @@ const main = async() => { console.log(caddyPluginsOutput); - // These don't need to be added to commit message - console.log(updateCustomPackage( - 'scopedPackages.x86_64-linux.lovelace-components.custom-sidebar', - )); - console.log(updateCustomPackage('some-sass-language-server')); - // nix-update executions let nixUpdateOutputs = ''; @@ -142,7 +133,9 @@ const main = async() => { updatePackage('jmusicbot'); updatePackage('pam-fprint-grosshack'); updatePackage('protonhax'); + updatePackage('some-sass-language-server'); updatePackage('trash-d'); + updatePackage('scopedPackages', 'lovelace-components', 'custom-sidebar'); updatePackage('scopedPackages', 'lovelace-components', 'material-rounded-theme'); diff --git a/apps/update-sources/src/misc.ts b/apps/update-sources/src/misc.ts index 76120391..e96cd46b 100644 --- a/apps/update-sources/src/misc.ts +++ b/apps/update-sources/src/misc.ts @@ -41,13 +41,6 @@ export const updateVuetorrent = () => { }; -export const updateCustomPackage = (pkg: string) => spawnSync( - `nix run ${FLAKE}#${pkg}.update`, - [], - { shell: true }, -).stderr.toString(); - - const getAttrVersion = (attr: string): string => spawnSync('nix', ['eval', '--raw', `${FLAKE}#${attr}.version`], { shell: true }).stdout.toString(); diff --git a/packages/some-sass-language-server/default.nix b/packages/some-sass-language-server/default.nix index 481fe6d7..6f2f3538 100644 --- a/packages/some-sass-language-server/default.nix +++ b/packages/some-sass-language-server/default.nix @@ -3,6 +3,7 @@ lib, buildNpmPackage, makeWrapper, + nix-update-script, writeShellApplication, # update script deps nodejs_latest, @@ -32,15 +33,23 @@ in npmDepsHash = "sha256-BRo71A07BhrioiBFisCR01OrVFTIagVTIClZ2Tpjidk="; - passthru.update = writeShellApplication { - name = "update"; - runtimeInputs = [ - nodejs_latest - prefetch-npm-deps - jq - ]; - text = import ./update.nix; - }; + passthru.updateScript = let + script = writeShellApplication { + name = "update"; + runtimeInputs = [ + nodejs_latest + prefetch-npm-deps + jq + ]; + text = import ./update.nix; + }; + in + nix-update-script { + extraArgs = [ + "--version=skip" + "; ${script}" + ]; + }; meta = { mainProgram = pname; diff --git a/scopedPackages/lovelace-components/custom-sidebar/default.nix b/scopedPackages/lovelace-components/custom-sidebar/default.nix index 101cc3f6..ba6c87b5 100644 --- a/scopedPackages/lovelace-components/custom-sidebar/default.nix +++ b/scopedPackages/lovelace-components/custom-sidebar/default.nix @@ -4,6 +4,7 @@ nodejs, pnpm, stdenv, + nix-update-script, ... }: let inherit (builtins) fromJSON readFile; @@ -35,10 +36,18 @@ in hash = "sha256-II8expO942jHylgbiePr5+V+t+UVh7fenffoyVFn/8k="; }; - passthru.update = concatTextFile { - name = "update"; - files = [./update.sh]; - executable = true; - destination = "/bin/update"; - }; + passthru.updateScript = let + script = "${concatTextFile { + name = "update"; + files = [./update.sh]; + executable = true; + destination = "/bin/update"; + }}/bin/update"; + in + nix-update-script { + extraArgs = [ + "--version=skip" + "; ${script}" + ]; + }; })