nixos-configs/apps/update/default.nix
matt1432 8570bf8ef4
All checks were successful
Discord / discord commits (push) Has been skipped
feat(updateScript): clean up output
2024-10-30 02:27:07 -04:00

32 lines
730 B
Nix

{
lib,
buildNpmPackage,
callPackage,
makeWrapper,
nodejs_latest,
...
}: let
inherit (lib) concatMapStringsSep getBin;
packageJSON = builtins.fromJSON (builtins.readFile ./package.json);
in
buildNpmPackage rec {
pname = packageJSON.name;
inherit (packageJSON) version;
src = ./.;
npmDepsHash = "sha256-3fU6eS6CPqBhD1zmsHnZs7Pk2mEiucPMrOSdS81+Ml8=";
runtimeInputs = [
(callPackage ../../nixosModules/docker/updateImage.nix {})
];
nativeBuildInputs = [makeWrapper];
postInstall = ''
wrapProgram $out/bin/${pname} \
--prefix PATH : ${concatMapStringsSep ":" (p: getBin p) runtimeInputs}
'';
nodejs = nodejs_latest;
meta.mainProgram = pname;
}