From b900c7d1c095b8f15f4e12ceeaf78996a3c77437 Mon Sep 17 00:00:00 2001 From: inexcode Date: Fri, 12 Aug 2022 16:12:02 +0400 Subject: [PATCH] Add API 2.0 to the repo --- default.nix | 4 ++ pkgs/selfprivacy-graphql-api/default.nix | 59 ++++++++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 pkgs/selfprivacy-graphql-api/default.nix diff --git a/default.nix b/default.nix index 10aa1f5..a2fafdc 100644 --- a/default.nix +++ b/default.nix @@ -34,4 +34,8 @@ self: super: rec { nixpkgs = pkgs; pythonPkgs = pythonPackages; }; + selfprivacy-graphql-api = super.callPackage ./pkgs/selfprivacy-graphql-api { + nixpkgs = pkgs; + pythonPkgs = pythonPackages; + }; } diff --git a/pkgs/selfprivacy-graphql-api/default.nix b/pkgs/selfprivacy-graphql-api/default.nix new file mode 100644 index 0000000..db0995e --- /dev/null +++ b/pkgs/selfprivacy-graphql-api/default.nix @@ -0,0 +1,59 @@ +{ nixpkgs ? import { }, 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