diff --git a/overlays/default.nix b/overlays/default.nix index d994a91..0dc7bbf 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -10,6 +10,7 @@ let flake8 ipython jedi + jedi-language-server mypy pylint pyyaml @@ -48,14 +49,19 @@ let }); in rec { - #python3 = final.unstable.python3; gregpy = myPython; + ## Testing adding python packages in the correct manner + pythonPackagesExtensions = (prev.pythonPackagesExtensions or []) ++ [ + (python-final: python-prev: { + django-rapyd-modernauth = python-final.callPackage ./django-rapyd-modernauth.nix {}; + }) + ]; + my-py-addons = rec { copier = cp ./copier.nix { inherit iteration-utilities jinja2-ansible-filters - pydantic pyyaml-include ; }; @@ -71,8 +77,8 @@ in rec { molecule-podman = cp ./molecule-podman.nix { inherit molecule; }; - pydantic = cp ./pydantic.nix {}; pyyaml-include = cp ./pyyaml-include.nix {}; + xonsh-apipenv = cp ./xonsh-apipenv.nix {}; xonsh-direnv = cp ./xonsh-direnv.nix {}; }; @@ -89,7 +95,10 @@ in rec { xonsh = prev.xonsh.overridePythonAttrs (old: rec{ python3 = final.gregpy; - propagatedBuildInputs = old.propagatedBuildInputs ++ [ my-py-addons.xonsh-direnv ]; + propagatedBuildInputs = old.propagatedBuildInputs ++ [ + my-py-addons.xonsh-apipenv + my-py-addons.xonsh-direnv + ]; }); bitwarden = macOver ./mac/bitwarden.nix "bitwarden"; diff --git a/overlays/django-rapyd-modernauth.nix b/overlays/django-rapyd-modernauth.nix new file mode 100644 index 0000000..dd637b2 --- /dev/null +++ b/overlays/django-rapyd-modernauth.nix @@ -0,0 +1,45 @@ +{ lib, buildPythonPackage, fetchPypi, pkgs}: + +let + pydeps = pypkgs: with pypkgs; [ + click + django + python-dotenv + pytz + setuptools + sqlparse + zipp + ]; +in buildPythonPackage rec { + pname = "django-rapyd-modernauth"; + version = "0.0.4"; + + src = fetchPypi { + inherit pname version; + sha256 = "sha256-kDZjI32LcKsmLI38ruINKOUfi6lWTIqXF5qIQHi0LeQ="; + }; + + meta = with lib; { + description = "A Django application that provides a custom User model where the username is the email address."; + homepage = "https://github.com/karthicraghupathi/django_rapyd_modernauth"; + license = licenses.afl20; + maintainers = []; + }; + + doCheck = false; + + buildInputs = with pkgs; [ + #(python3.withPackages pydeps) + click + django + python-dotenv + pytz + setuptools + sqlparse + zipp + ]; + + nativeBuildInputs = with pkgs; [ + #(python3.withPackages pydeps) + ]; +} diff --git a/overlays/packages.nix b/overlays/packages.nix index 6ec6270..c98d5cb 100644 --- a/overlays/packages.nix +++ b/overlays/packages.nix @@ -14,6 +14,10 @@ flake-utils.lib.eachDefaultSystemMap (system: brew = pkgs.callPackage ./homebrew.nix {}; + django-rapyd-modernauth = pkgs.callPackage ./django-rapyd-modernauth.nix { + buildPythonPackage = pkgs.python3.pkgs.buildPythonPackage; + }; + xonsh-direnv = pkgs.callPackage ./xonsh-direnv.nix { buildPythonPackage = pkgs.python3.pkgs.buildPythonPackage; fetchPypi = pkgs.python.pkgs.fetchPypi; diff --git a/overlays/pydantic.nix b/overlays/pydantic.nix deleted file mode 100644 index 9e97e0b..0000000 --- a/overlays/pydantic.nix +++ /dev/null @@ -1,33 +0,0 @@ -{ lib, buildPythonPackage, fetchPypi, pkgs, -typing-extensions -}: - -let - pydeps = [ - typing-extensions - ]; -in buildPythonPackage rec { - pname = "pydantic"; - version = "1.10.2"; - - src = fetchPypi { - inherit pname version; - sha256 = "sha256-kbjiGIUu9gB8K5jNhhYBxqCfGqMru7dPq1scM9Sh5BA="; - }; - - meta = with lib; { - description = "Data validation and settings management using Python type hints."; - homepage = "https://github.com/pydantic/pydantic"; - license = licenses.mit; - maintainers = []; - }; - - doCheck = false; - - propagatedBuildInputs = pydeps; - - buildInputs = []; - - nativeBuildInputs = with pkgs; [ - ]; -} diff --git a/overlays/xonsh-apipenv.nix b/overlays/xonsh-apipenv.nix new file mode 100644 index 0000000..0b5e2c0 --- /dev/null +++ b/overlays/xonsh-apipenv.nix @@ -0,0 +1,29 @@ +{ lib, buildPythonPackage, fetchFromGitHub, pkgs}: + +buildPythonPackage rec { + pname = "xonsh-apipenv"; + version = "0.4.0"; + + src = fetchFromGitHub { + owner = "deeuu"; + repo = "xontrib-apipenv"; + rev = "0.4.0"; + sha256 = "sha256-uFn3kF7P4wykd72XkQx6cPWLhBOh2SDQBcI3Idc2rFM="; + }; + + meta = with lib; { + description = "Auto pipenv support for Xonsh"; + homepage = "https://github.com/deeuu/xontrib-apipenv"; + license = licenses.mit; + maintainers = []; + }; + + doCheck = false; + + buildInputs = with pkgs; [ + pipenv + ]; + + nativeBuildInputs = [ + ]; +}