Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at 20.09 1.8 kB view raw
1{ lib 2, buildPythonPackage 3, python, runCommand 4, fetchFromGitHub 5, ConfigArgParse, acme, configobj, cryptography, distro, josepy, parsedatetime, pyRFC3339, pyopenssl, pytz, requests, six, zope_component, zope_interface 6, dialog, mock, gnureadline 7, pytest_xdist, pytest, pytestCheckHook, dateutil 8}: 9 10buildPythonPackage rec { 11 pname = "certbot"; 12 version = "1.7.0"; 13 14 src = fetchFromGitHub { 15 owner = pname; 16 repo = pname; 17 rev = "v${version}"; 18 sha256 = "1fx29gsa3glwh0ik5k2gynwdz6i3ckq9aakf6ip92n3qyh6l08a8"; 19 }; 20 21 sourceRoot = "source/${pname}"; 22 23 propagatedBuildInputs = [ 24 ConfigArgParse 25 acme 26 configobj 27 cryptography 28 distro 29 josepy 30 parsedatetime 31 pyRFC3339 32 pyopenssl 33 pytz 34 requests 35 six 36 zope_component 37 zope_interface 38 ]; 39 40 buildInputs = [ dialog mock gnureadline ]; 41 42 checkInputs = [ 43 dateutil 44 pytest 45 pytestCheckHook 46 pytest_xdist 47 ]; 48 49 pytestFlagsArray = [ "-o cache_dir=$(mktemp -d)" ]; 50 51 doCheck = true; 52 53 makeWrapperArgs = [ "--prefix PATH : ${dialog}/bin" ]; 54 55 # certbot.withPlugins has a similar calling convention as python*.withPackages 56 # it gets invoked with a lambda, and invokes that lambda with the python package set matching certbot's: 57 # certbot.withPlugins (cp: [ cp.certbot-dns-foo ]) 58 passthru.withPlugins = f: let 59 pythonEnv = python.withPackages f; 60 61 in runCommand "certbot-with-plugins" { 62 } '' 63 mkdir -p $out/bin 64 cd $out/bin 65 ln -s ${pythonEnv}/bin/certbot 66 ''; 67 68 meta = with lib; { 69 homepage = src.meta.homepage; 70 description = "ACME client that can obtain certs and extensibly update server configurations"; 71 platforms = platforms.unix; 72 maintainers = with maintainers; [ domenkozar ]; 73 license = with licenses; [ asl20 ]; 74 }; 75}