Try a different tack...

This commit is contained in:
2023-01-07 14:47:35 -08:00
parent 931c60ee57
commit 00bc4d1da7
2 changed files with 31 additions and 20 deletions
+29 -8
View File
@@ -1,12 +1,33 @@
{ pkgs, lib, ... }:
pkgs.stdenv.mkDerivation {
let
objectifier-src = pkgs.stdenv.mkDerivation {
name = "objectifier";
src = ./src;
phases = [ "installPhase" ];
installPhase = ''
mkdir -p $out
cp $src/detector.py $out/detector.py
cp $src/yolo-cli.py $out/objectifier.py
'';
};
pythonYolo = pkgs.python3.withPackages (pyPkgs:
with pyPkgs; [
gunicorn
fastapi
gunicorn
opencv4
python-multipart
uvicorn
]);
in pkgs.writeShellApplication {
name = "objectifier";
src = ./src;
phases = [ "installPhase" ];
installPhase = ''
mkdir -p $out
cp $src/detector.py $out/detector.py
cp $src/yolo-cli.py $out/objectifier.py
'';
runtimeInputs = [ pythonYolo ];
text = pkgs.lib.concatStringsSep " " [
"gunicorn"
"objectifier:app"
"-k uvicorn.workers.UvicornWorker"
''"$@"''
];
}