Files
infra/pkgs/gtcm-file-uploader.nix
T

40 lines
815 B
Nix

{
fetchgit,
buildNpmPackage,
pkgs,
dataDir ? "/var/lib/gtcm-file-uploader",
}:
let
repoSrc = fetchgit {
url = "https://git.b4l.co.th/newedge/think-greaterchiangmai";
rev = "fdb71d61c7786b1a0f3fa595d2eb68e3438a55b1";
hash = "sha256-oR1DHYO7YXHGWPEdewtPuHnIlQ+c3BuKI7B3QNMDCx4=";
};
src = "${repoSrc}/upload-large-file";
in
buildNpmPackage {
pname = "gtcm-file-uploader";
version = "1.1.4";
nativeBuildInputs = with pkgs; [
nodejs
];
inherit src;
npmDepsHash = "sha256-JEp2F1CQfuV9fSYZRdRO+BiOE9dy1ReK6doJcqCuxu4=";
buildPhase = ''
npm install
'';
installPhase = ''
runHook preInstall
mkdir -p $out
cp -r * $out
ln -s ${dataDir}/.env $out/.env
ln -s ${dataDir}/gtcm-file-uploader/uploads $out/src/be/uploads
runHook postInstall
'';
}