objectifier/objectifier.nix

34 lines
692 B
Nix
Raw Normal View History

2023-01-06 14:46:11 -08:00
{ pkgs, lib, ... }:
2023-01-07 14:47:35 -08:00
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 {
2023-01-06 14:46:11 -08:00
name = "objectifier";
2023-01-07 14:47:35 -08:00
runtimeInputs = [ pythonYolo ];
text = pkgs.lib.concatStringsSep " " [
"gunicorn"
"objectifier:app"
"-k uvicorn.workers.UvicornWorker"
''"$@"''
];
2023-01-06 14:46:11 -08:00
}