transition to flakes

This commit is contained in:
Alexander Tomokhov 2023-07-16 04:17:40 +04:00
parent c6c151faec
commit 53ed9b3f5f
3 changed files with 50 additions and 96 deletions

View file

@ -1,38 +1,5 @@
let _final: prev: {
pkgs = import <nixpkgs> { }; selfprivacy-graphql-api = prev.callPackage ./pkgs/selfprivacy-graphql-api {
in pythonPackages = prev.python310Packages;
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;
}; };
} }

11
flake.nix Normal file
View file

@ -0,0 +1,11 @@
{
description = "Selfprivacy overlay";
outputs = { ... }: {
overlay = _final: prev: {
selfprivacy-graphql-api = prev.callPackage ./pkgs/selfprivacy-graphql-api {
pythonPackages = prev.python310Packages;
};
};
};
}

View file

@ -1,50 +1,28 @@
{ nixpkgs ? import <nixpkgs> { }, pythonPkgs ? nixpkgs.pkgs.python39Packages }: { pythonPackages }:
let pythonPackages.buildPythonApplication rec {
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"; pname = "selfprivacy-graphql-api";
version = "2.0.9"; version = "2.1.3"; # (version updates here are susceptible to human error)
src = builtins.fetchGit { src = builtins.fetchGit {
url = "https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git"; url = "https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git";
rev = "0a09a338b850704f221bd9b451519290584ef209"; rev = "b3a37e8b1fd50457b4d48b9421d77603437e6f2f";
}; };
propagatedBuildInputs = [ propagatedBuildInputs = with pythonPackages; [
setuptools
portalocker
pytz
pytest
pytest-mock
pytest-datadir
huey
gevent
mnemonic
pydantic
typing-extensions
strawberry_graphql
psutil
fastapi fastapi
gevent
huey
mnemonic
portalocker
psutil
pydantic
pytest
pytest-datadir
pytest-mock
pytz
redis
setuptools
strawberry-graphql
typing-extensions
uvicorn uvicorn
]; ];
meta = { meta = {
@ -53,9 +31,7 @@ let
''; '';
}; };
passthru = { passthru = {
pythonPath = pythonPkgs.makePythonPath propagatedBuildInputs; # TODO explain what's the purpose of this?
pythonPath = pythonPackages.makePythonPath propagatedBuildInputs;
}; };
}; }
drv = pythonPkgs.callPackage selfprivacy-graphql-api { };
in
drv