1
0
Fork 0

make ssl module more generic

This commit is contained in:
ibizaman 2023-09-14 22:21:15 -07:00
parent 44465c37c2
commit a971124464

View file

@ -9,7 +9,16 @@ in
sopsFile = lib.mkOption { sopsFile = lib.mkOption {
type = lib.types.path; type = lib.types.path;
description = "Sops file location"; description = ''Sops file location.
To use Linode to prove the dns challenge, the content of the file should be the following,
with XXX replaced by your Linode API token.
LINODE_HTTP_TIMEOUT=10
LINODE_POLLING_INTERVAL=10
LINODE_PROPAGATION_TIMEOUT=240
LINODE_TOKEN=XXX
'';
example = "secrets/haproxy.yaml"; example = "secrets/haproxy.yaml";
}; };
@ -19,6 +28,18 @@ in
example = "domain.com"; example = "domain.com";
}; };
dnsProvider = lib.mkOption {
description = lib.mdDoc "DNS provider.";
type = lib.types.str;
example = "linode";
};
dnsResolver = lib.mkOption {
description = lib.mdDoc "IP of a DNS server used to resolve hostnames.";
type = lib.types.str;
default = "8.8.8.8";
};
adminEmail = lib.mkOption { adminEmail = lib.mkOption {
description = lib.mdDoc "Admin email in case certificate retrieval goes wrong."; description = lib.mdDoc "Admin email in case certificate retrieval goes wrong.";
type = lib.types.str; type = lib.types.str;
@ -40,20 +61,12 @@ in
}; };
defaults = { defaults = {
email = cfg.adminEmail; email = cfg.adminEmail;
dnsProvider = "linode"; inherit (cfg) dnsProvider dnsResolver;
dnsResolver = "8.8.8.8"; credentialsFile = "/run/secrets/acme";
# For example, to use Linode to prove the dns challenge,
# the content of the file should be the following, with
# XXX replaced by your Linode API token.
# LINODE_HTTP_TIMEOUT=10
# LINODE_POLLING_INTERVAL=10
# LINODE_PROPAGATION_TIMEOUT=240
# LINODE_TOKEN=XXX
credentialsFile = "/run/secrets/linode";
enableDebugLogs = false; enableDebugLogs = false;
}; };
}; };
sops.secrets.linode = { sops.secrets.acme = {
inherit (cfg) sopsFile; inherit (cfg) sopsFile;
restartUnits = [ "acme-${cfg.domain}.service" ]; restartUnits = [ "acme-${cfg.domain}.service" ];
}; };