diff --git a/default.nix b/default.nix index c8189c0..5ba8b8f 100644 --- a/default.nix +++ b/default.nix @@ -1,38 +1,5 @@ -let - pkgs = import { }; -in - -self: super: rec { - python39 = super.python39.override { - packageOverrides = python-self: python-super: { - strawberry_graphql = python-super.buildPythonPackage rec { - pname = "strawberry-graphql"; - version = "0.123.0"; - format = "pyproject"; - patches = [ - ./strawberry-graphql.patch - ]; - propagatedBuildInputs = with self.python39Packages; [ - typing-extensions - graphql-core - python-multipart - python-dateutil - flask - pydantic - pygments - poetry - ]; - src = python-super.fetchPypi { - inherit pname version; - sha256 = "sha256-KsmZ5Xv8tUg6yBxieAEtvoKoRG60VS+iVGV0X6oCExo="; - }; - }; - }; - }; - pythonPackages = python39.pkgs; - selfprivacy-api = super.callPackage ./pkgs/selfprivacy-api {}; - selfprivacy-graphql-api = super.callPackage ./pkgs/selfprivacy-graphql-api { - nixpkgs = pkgs; - pythonPkgs = pythonPackages; +_final: prev: { + selfprivacy-graphql-api = prev.callPackage ./pkgs/selfprivacy-graphql-api { + pythonPackages = prev.python310Packages; }; } diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..e1f1afc --- /dev/null +++ b/flake.nix @@ -0,0 +1,11 @@ +{ + description = "Selfprivacy overlay"; + + outputs = { ... }: { + overlay = _final: prev: { + selfprivacy-graphql-api = prev.callPackage ./pkgs/selfprivacy-graphql-api { + pythonPackages = prev.python310Packages; + }; + }; + }; +} diff --git a/pkgs/selfprivacy-graphql-api/default.nix b/pkgs/selfprivacy-graphql-api/default.nix index 63ba638..a9c8589 100644 --- a/pkgs/selfprivacy-graphql-api/default.nix +++ b/pkgs/selfprivacy-graphql-api/default.nix @@ -1,61 +1,37 @@ -{ nixpkgs ? import { }, pythonPkgs ? nixpkgs.pkgs.python39Packages }: +{ pythonPackages }: -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 - }: - pythonPkgs.buildPythonApplication rec { - pname = "selfprivacy-graphql-api"; - version = "2.0.9"; - src = builtins.fetchGit { - url = "https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git"; - rev = "0a09a338b850704f221bd9b451519290584ef209"; - }; - 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 - ''; - }; - passthru = { - pythonPath = pythonPkgs.makePythonPath propagatedBuildInputs; - }; - }; - drv = pythonPkgs.callPackage selfprivacy-graphql-api { }; -in -drv +pythonPackages.buildPythonApplication rec { + pname = "selfprivacy-graphql-api"; + version = "2.1.3"; # (version updates here are susceptible to human error) + src = builtins.fetchGit { + url = "https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git"; + rev = "b3a37e8b1fd50457b4d48b9421d77603437e6f2f"; + }; + propagatedBuildInputs = with pythonPackages; [ + fastapi + gevent + huey + mnemonic + portalocker + psutil + pydantic + pytest + pytest-datadir + pytest-mock + pytz + redis + setuptools + strawberry-graphql + typing-extensions + uvicorn + ]; + meta = { + description = '' + SelfPrivacy Server Management API + ''; + }; + passthru = { + # TODO explain what's the purpose of this? + pythonPath = pythonPackages.makePythonPath propagatedBuildInputs; + }; +}