mob next [ci-skip] [ci skip] [skip ci]

lastFile:flake.nix
This commit is contained in:
2026-01-09 14:42:19 +07:00
parent 49449d70e6
commit e35ebb7e90
4 changed files with 75 additions and 0 deletions

40
pkgs/file-uploader.nix Normal file
View File

@@ -0,0 +1,40 @@
{
fetchgit,
buildNpmPackage,
pkgs,
dataDir ? "/var/lib/file-uploader",
}:
let
repoSrc = fetchgit {
url = "https://git.b4l.co.th/newedge/think-greaterchiangmai";
rev = "6f8c8d7dfaf5a0c1eb2077de1d6fb35ceaf3d4ec";
hash = "sha256-2mCdn8xGjWZrANclctGTmxQhkNc43VzlzMTVwVIFJcM=";
};
src = "${repoSrc}/upload-large-file";
in
buildNpmPackage {
pname = "file-uploader";
version = "1.0.0";
nativeBuildInputs = with pkgs; [
nodejs_20
breakpointHook
];
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}/file-uploader/uploads $out/src/be/uploads
runHook postInstall
'';
}

View File

@@ -1,4 +1,5 @@
final: prev: {
think-gtcm = final.callPackage ./think-gtcm.nix { };
think-backend-gtcm = final.callPackage ./think-backend-gtcm.nix { php = final.php83; };
file-uploader = final.callPackage ./file-uploader.nix { };
}