From c6b6f7c7f3aa0d6245af6f89b15439fb4a9a2d0f Mon Sep 17 00:00:00 2001 From: catvayor Date: Fri, 25 Oct 2024 15:10:54 +0200 Subject: [PATCH] feat(init): init --- default.nix | 5 +++++ overlay.nix | 5 +++++ pkgs/django-cas-ng.nix | 47 ++++++++++++++++++++++++++++++++++++++++++ pkgs/python-cas.nix | 43 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 100 insertions(+) create mode 100644 default.nix create mode 100644 overlay.nix create mode 100644 pkgs/django-cas-ng.nix create mode 100644 pkgs/python-cas.nix diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..5f24d4d --- /dev/null +++ b/default.nix @@ -0,0 +1,5 @@ +{ pkgs, lib ? pkgs.lib }: with lib; +mapAttrs' (name: _: { + value = pkgs.callPackages (./pkgs/${name}) { }; + name = removeSuffix ".nix" name; +}) (builtins.readDir ./pkgs) diff --git a/overlay.nix b/overlay.nix new file mode 100644 index 0000000..8f04c51 --- /dev/null +++ b/overlay.nix @@ -0,0 +1,5 @@ +self: super: with super.lib; +mapAttrs' (name: _: rec { + value = super.callPackages ("./pkgs/${name}") { }; + name = removeSuffix ".nix" name; +}) (builtins.readDir ./pkgs) diff --git a/pkgs/django-cas-ng.nix b/pkgs/django-cas-ng.nix new file mode 100644 index 0000000..3821382 --- /dev/null +++ b/pkgs/django-cas-ng.nix @@ -0,0 +1,47 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + setuptools, + wheel, + flake8, + lxml, + python-cas, + requests, + django, +}: + +buildPythonPackage rec { + pname = "django-cas-ng"; + version = "5.0.1"; + pyproject = true; + + src = fetchFromGitHub { + owner = "django-cas-ng"; + repo = "django-cas-ng"; + rev = "v${version}"; + hash = "sha256-jGoros8HbSWCtWvw2ilttm0MtWtEZDUy5KWNfczJvWk="; + }; + + nativeBuildInputs = [ + setuptools + wheel + ]; + + propagatedBuildInputs = [ + flake8 + lxml + python-cas + requests + django + ]; + + # pythonImportsCheck = [ "django_cas_ng" ]; + + meta = with lib; { + description = "Django CAS 1.0/2.0/3.0 client authentication library, support Django 2.0, 2.1, 2.2, 3.0 and Python 3.5"; + homepage = "https://github.com/django-cas-ng/django-cas-ng"; + license = licenses.mit; + maintainers = with maintainers; [ ]; + }; +} diff --git a/pkgs/python-cas.nix b/pkgs/python-cas.nix new file mode 100644 index 0000000..8d51258 --- /dev/null +++ b/pkgs/python-cas.nix @@ -0,0 +1,43 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + setuptools, + wheel, + lxml, + requests, + six, +}: + +buildPythonPackage rec { + pname = "python-cas"; + version = "1.6.0"; + pyproject = true; + + src = fetchFromGitHub { + owner = "python-cas"; + repo = "python-cas"; + rev = "v${version}"; + hash = "sha256-0lpjG/Sma0tJGtahiFE1CjvTyswrBUp+F6f1S65b+lk="; + }; + + nativeBuildInputs = [ + setuptools + wheel + ]; + + propagatedBuildInputs = [ + lxml + requests + six + ]; + + # pythonImportsCheck = [ "python_cas" ]; + + meta = with lib; { + description = "Python CAS (Central Authentication Service) client library support CAS 1.0/2.0/3.0"; + homepage = "https://github.com/python-cas/python-cas"; + license = licenses.mit; + maintainers = with maintainers; [ ]; + }; +}