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 = "b67934a98b5715ae756c13e3b37000d6886afa21";
hash = "sha256-/qnuDucXSV/MVFuN+zYxncz75dpu7NVNRCANG5KOn28=";
};
src = "${repoSrc}/upload-large-file";
in
buildNpmPackage {
pname = "gtcm-file-uploader";
version = "1.1.0";
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
'';
}