nixos-configs/apps/update/default.nix

34 lines
750 B
Nix
Raw Normal View History

{
lib,
buildNpmPackage,
callPackage,
makeWrapper,
nodejs_latest,
...
}: let
inherit (lib) concatMapStringsSep getBin;
inherit (builtins) readFile fromJSON;
packageJSON = fromJSON (readFile ./package.json);
in
buildNpmPackage rec {
2024-08-06 20:35:11 -04:00
pname = packageJSON.name;
inherit (packageJSON) version;
src = ./.;
2024-10-12 13:09:59 -04:00
npmDepsHash = "sha256-cg+U7MSeeSDrzSWfXAd69FBLN3R8n4+aCSggrdThZHw=";
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;
}