1{
2 lib,
3 buildPythonPackage,
4 python,
5 runCommand,
6 fetchFromGitHub,
7 configargparse,
8 acme,
9 configobj,
10 cryptography,
11 distro,
12 josepy,
13 parsedatetime,
14 pyrfc3339,
15 pyopenssl,
16 pytz,
17 requests,
18 six,
19 zope-component,
20 zope-interface,
21 setuptools,
22 dialog,
23 gnureadline,
24 pytest-xdist,
25 pytestCheckHook,
26 python-dateutil,
27}:
28
29buildPythonPackage rec {
30 pname = "certbot";
31 version = "2.11.0";
32 pyproject = true;
33
34 src = fetchFromGitHub {
35 owner = "certbot";
36 repo = "certbot";
37 rev = "refs/tags/v${version}";
38 hash = "sha256-Qee7lUjgliG5fmUWWPm3MzpGJHUF/DXZ08UA6kkWjjk=";
39 };
40
41 sourceRoot = "${src.name}/${pname}";
42
43 nativeBuildInputs = [ setuptools ];
44
45 propagatedBuildInputs = [
46 configargparse
47 acme
48 configobj
49 cryptography
50 distro
51 josepy
52 parsedatetime
53 pyrfc3339
54 pytz
55 setuptools # for pkg_resources
56 ];
57
58 buildInputs = [
59 dialog
60 gnureadline
61 ];
62
63 nativeCheckInputs = [
64 python-dateutil
65 pytestCheckHook
66 pytest-xdist
67 ];
68
69 pytestFlagsArray = [ "-o cache_dir=$(mktemp -d)" ];
70
71 makeWrapperArgs = [ "--prefix PATH : ${dialog}/bin" ];
72
73 # certbot.withPlugins has a similar calling convention as python*.withPackages
74 # it gets invoked with a lambda, and invokes that lambda with the python package set matching certbot's:
75 # certbot.withPlugins (cp: [ cp.certbot-dns-foo ])
76 passthru.withPlugins =
77 f:
78 let
79 pythonEnv = python.withPackages f;
80 in
81 runCommand "certbot-with-plugins" { } ''
82 mkdir -p $out/bin
83 cd $out/bin
84 ln -s ${pythonEnv}/bin/certbot
85 '';
86
87 meta = with lib; {
88 homepage = "https://github.com/certbot/certbot";
89 changelog = "https://github.com/certbot/certbot/blob/${src.rev}/certbot/CHANGELOG.md";
90 description = "ACME client that can obtain certs and extensibly update server configurations";
91 platforms = platforms.unix;
92 mainProgram = "certbot";
93 maintainers = with maintainers; [ domenkozar ];
94 license = with licenses; [ asl20 ];
95 };
96}