nixos/acme: add an option for reloading systemd services after renewal

This commit is contained in:
Poscat 2021-10-06 17:53:04 +08:00 committed by Jonathan Ringer
parent c85680db4f
commit 942f57e79b

View File

@ -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 <code>systemctl try-reload-or-restart</code>
on.
'';
};
postRun = mkOption {
type = types.lines;
default = "";