From 6ad85207bc94491df4a41e58b3b27586e9571ae1 Mon Sep 17 00:00:00 2001 From: MakiseKurisu Date: Sun, 24 Nov 2024 14:16:22 +0800 Subject: [PATCH] fastapi-dls: init at 1.4.1 --- pkgs/by-name/fa/fastapi-dls/package.nix | 63 +++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 pkgs/by-name/fa/fastapi-dls/package.nix diff --git a/pkgs/by-name/fa/fastapi-dls/package.nix b/pkgs/by-name/fa/fastapi-dls/package.nix new file mode 100644 index 0000000000000..75999c37da96f --- /dev/null +++ b/pkgs/by-name/fa/fastapi-dls/package.nix @@ -0,0 +1,63 @@ +{ + lib, + python3, + fetchFromGitLab, + gitUpdater, + makeWrapper, +}: + +let + + pythonEnv = python3.withPackages ( + packages: + with packages; + [ + fastapi + uvicorn + python-jose + pycryptodome + python-dateutil + sqlalchemy + markdown + python-dotenv + ] + ++ uvicorn.optional-dependencies.standard + ); + + version = "1.4.1"; + +in +python3.pkgs.buildPythonApplication { + pname = "fastapi-dls"; + inherit version; + pyproject = false; + + src = fetchFromGitLab { + domain = "git.collinwebdesigns.de"; + owner = "oscar.krause"; + repo = "fastapi-dls"; + rev = "refs/tags/${version}"; + hash = "sha256-H4mtmJ4iQXPZFWQPm12aH/kdg9TAMgHkvkbaHfxfS3I="; + }; + + postInstall = '' + mkdir -p $out/bin $out/share/fastapi-dls + cp -r README.md app $out/share/fastapi-dls + + makeWrapper ${pythonEnv}/bin/uvicorn $out/bin/fastapi-dls \ + --add-flags "--app-dir $out/share/fastapi-dls/app" \ + --add-flags "--proxy-headers" \ + --add-flags "main:app" + ''; + + passthru.updateScript = gitUpdater { }; + + meta = with lib; { + homepage = "https://git.collinwebdesigns.de/oscar.krause/fastapi-dls"; + license = licenses.unfree; + description = "Minimal Delegated License Service (DLS)"; + mainProgram = "fastapi-dls"; + platforms = platforms.linux; + maintainers = with maintainers; [ makisekurisu ]; + }; +}