Add API 2.0 to the repo

test-upstream-strawberry
inexcode 2022-08-12 16:12:02 +04:00
parent 548f31511e
commit b900c7d1c0
2 changed files with 63 additions and 0 deletions

View File

@ -34,4 +34,8 @@ self: super: rec {
nixpkgs = pkgs;
pythonPkgs = pythonPackages;
};
selfprivacy-graphql-api = super.callPackage ./pkgs/selfprivacy-graphql-api {
nixpkgs = pkgs;
pythonPkgs = pythonPackages;
};
}

View File

@ -0,0 +1,59 @@
{ nixpkgs ? import <nixpkgs> { }, pythonPkgs ? nixpkgs.pkgs.python39Packages }:
let
inherit (nixpkgs) pkgs;
inherit pythonPkgs;
selfprivacy-graphql-api =
{ buildPythonPackage
, fetchPypi
, setuptools
, portalocker
, pytz
, pytest
, pytest-mock
, pytest-datadir
, huey
, gevent
, mnemonic
, pydantic
, typing-extensions
, strawberry_graphql
, psutil
, fastapi
, uvicorn
}:
buildPythonPackage rec {
pname = "selfprivacy-graphql-api";
version = "2.0.0";
src = builtins.fetchGit {
url = "https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git";
rev = "a96f6bd06733199cf4af3b05acdce1f1d43c85c2";
ref = "graphql";
};
propagatedBuildInputs = [
setuptools
portalocker
pytz
pytest
pytest-mock
pytest-datadir
huey
gevent
mnemonic
pydantic
typing-extensions
strawberry_graphql
psutil
fastapi
uvicorn
];
meta = {
description = ''
SelfPrivacy Server Management API
'';
};
};
drv = pythonPkgs.callPackage selfprivacy-graphql-api { };
in
if pkgs.lib.inNixShell then drv.env else drv