feat(update): get rid of updateCustomPackage func
All checks were successful
Discord / discord commits (push) Has been skipped

This commit is contained in:
matt1432 2025-02-16 20:40:18 -05:00
parent d5db4c4e88
commit 018a5aee9e
4 changed files with 37 additions and 33 deletions

View file

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

View file

@ -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();

View file

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

View file

@ -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}"
];
};
})