mirror of https://gitlab.crans.org/nounous/nixos
41 lines
801 B
Nix
41 lines
801 B
Nix
{
|
||
config,
|
||
info,
|
||
lib,
|
||
...
|
||
}:
|
||
|
||
let
|
||
cfg = info.services.acme;
|
||
|
||
inherit (lib) mkIf;
|
||
in
|
||
|
||
{
|
||
# Options : ../info/acme.nix
|
||
config = mkIf cfg.enable {
|
||
age.secrets = {
|
||
acme-env.file = ../../secrets/acme/env.age;
|
||
};
|
||
|
||
security.acme = {
|
||
acceptTerms = true;
|
||
|
||
defaults = {
|
||
email = "root@crans.org";
|
||
dnsPropagationCheck = false;
|
||
};
|
||
|
||
# Certificat wildcard par défaut pour les services utilisant acme
|
||
# TODO: À déplacer sur les VMs qui en ont besoin (e.g. coturn…).
|
||
certs."crans.org" = {
|
||
domain = "*.crans.org";
|
||
dnsProvider = "rfc2136";
|
||
# Contient le serveur à contacter avec le protocole
|
||
# et le mot de passe
|
||
environmentFile = config.age.secrets.acme-env.path;
|
||
};
|
||
};
|
||
};
|
||
}
|