diff --git a/pkgs/by-name/pr/pretix/plugins/default.nix b/pkgs/by-name/pr/pretix/plugins/default.nix index 70e643705c00..a60316e521e4 100644 --- a/pkgs/by-name/pr/pretix/plugins/default.nix +++ b/pkgs/by-name/pr/pretix/plugins/default.nix @@ -10,4 +10,6 @@ reluctant-stripe = callPackage ./reluctant-stripe.nix { }; stretchgoals = callPackage ./stretchgoals.nix { }; + + zugferd = callPackage ./zugferd.nix { }; } diff --git a/pkgs/by-name/pr/pretix/plugins/zugferd.nix b/pkgs/by-name/pr/pretix/plugins/zugferd.nix new file mode 100644 index 000000000000..3255eeb78bd3 --- /dev/null +++ b/pkgs/by-name/pr/pretix/plugins/zugferd.nix @@ -0,0 +1,47 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + pretix-plugin-build, + setuptools, + drafthorse, + ghostscript_headless, +}: + +buildPythonPackage rec { + pname = "pretix-zugferd"; + version = "2.2.0"; + pyproject = true; + + src = fetchFromGitHub { + owner = "pretix"; + repo = "pretix-zugferd"; + rev = "v${version}"; + hash = "sha256-ozFDNIA+0feHrHHvxcf+6Jh4L83svmPEE/rerd4Yim8="; + }; + + postPatch = '' + substituteInPlace pretix_zugferd/invoice.py \ + --replace-fail 'fallback="gs"' 'fallback="${lib.getExe ghostscript_headless}"' + ''; + + pythonRelaxDeps = [ "drafthorse" ]; + + build-system = [ + pretix-plugin-build + setuptools + ]; + + dependencies = [ drafthorse ]; + + doCheck = false; # no tests + + pythonImportsCheck = [ "pretix_zugferd" ]; + + meta = with lib; { + description = "Annotate pretix' invoices with ZUGFeRD data"; + homepage = "https://github.com/pretix/pretix-zugferd"; + license = licenses.asl20; + maintainers = with maintainers; [ hexa ]; + }; +}