2023-08-28 21:52:46 +02:00
|
|
|
{ options, config, lib, fn, pkgs, ... }:
|
2020-03-11 01:53:04 +01:00
|
|
|
|
|
|
|
with builtins;
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
cfg = config.machine;
|
|
|
|
in mkIf (elem "acme" cfg.services) {
|
|
|
|
security.acme = {
|
|
|
|
# see https://letsencrypt.org/repository/
|
|
|
|
acceptTerms = true;
|
|
|
|
email = fn.fileContentsOr
|
|
|
|
(toPath "${cfg.secretPath}/acme.mailAddr")
|
|
|
|
"${(elemAt cfg.mailAccounts 0).name}@${cfg.domain}";
|
|
|
|
};
|
|
|
|
}
|