From cc47d0d2f92589540eaa18025ff93212dcfae624 Mon Sep 17 00:00:00 2001 From: Poscat Date: Wed, 6 Oct 2021 17:53:04 +0800 Subject: [PATCH] nixos/acme: add an option for reloading systemd services after renewal (cherry picked from commit 88ad030bba8b90da97ac9638b0eec693fe78fc03) --- nixos/modules/security/acme.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/nixos/modules/security/acme.nix b/nixos/modules/security/acme.nix index cfbc8e91903e..88c5774d187c 100644 --- a/nixos/modules/security/acme.nix +++ b/nixos/modules/security/acme.nix @@ -314,6 +314,9 @@ let if [ -e renewed ]; then rm renewed ${data.postRun} + ${optionalString (data.reloadServices != []) + "systemctl --no-block try-reload-or-restart ${escapeShellArgs data.reloadServices}" + } fi ''); }; @@ -474,6 +477,15 @@ let description = "Group running the ACME client."; }; + reloadServices = mkOption { + type = types.listOf types.str; + default = []; + description = '' + The list of systemd services to call systemctl try-reload-or-restart + on. + ''; + }; + postRun = mkOption { type = types.lines; default = "";