From 718a4496dfbbb8f6917e9737807e10e4b074dbf4 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Thu, 9 Jul 2020 14:11:25 +0200 Subject: [PATCH] certbot: add certbot.withPlugins This can be used to wrap certbot to include some plugins. certbot.withPlugins has a similar calling convention as python*.withPackages: ``` certbot.withPlugins (cp: [ cp.certbot-dns-foo ]) ``` --- .../development/python-modules/certbot/default.nix | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/pkgs/development/python-modules/certbot/default.nix b/pkgs/development/python-modules/certbot/default.nix index 335e62e6a8b..79e5c3288b7 100644 --- a/pkgs/development/python-modules/certbot/default.nix +++ b/pkgs/development/python-modules/certbot/default.nix @@ -1,5 +1,6 @@ { lib , buildPythonPackage +, python, runCommand , fetchFromGitHub , ConfigArgParse, acme, configobj, cryptography, distro, josepy, parsedatetime, pyRFC3339, pyopenssl, pytz, requests, six, zope_component, zope_interface , dialog, mock, gnureadline @@ -51,6 +52,19 @@ buildPythonPackage rec { makeWrapperArgs = [ "--prefix PATH : ${dialog}/bin" ]; + # certbot.withPlugins has a similar calling convention as python*.withPackages + # it gets invoked with a lambda, and invokes that lambda with the python package set matching certbot's: + # certbot.withPlugins (cp: [ cp.certbot-dns-foo ]) + passthru.withPlugins = f: let + pythonEnv = python.withPackages f; + + in runCommand "certbot-with-plugins" { + } '' + mkdir -p $out/bin + cd $out/bin + ln -s ${pythonEnv}/bin/certbot + ''; + meta = with lib; { homepage = src.meta.homepage; description = "ACME client that can obtain certs and extensibly update server configurations";