nixos-configs/apps/update/default.nix
matt1432 df50815aba
All checks were successful
Discord / discord commits (push) Has been skipped
refactor(upScript): separate funcs in more files
2024-11-13 15:17:45 -05: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-5miQfnSy559jVsqyZM5LqegMuIVsd+LOdsZ8FaHy24A=";
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;
}