1
0
Fork 0
nix-config/modules/nixos/services/acme/default.nix
Philipp 5792e478af
add(acme,nginx): add certificate generation and nginx for the services
This replaces caddy and the port exposure, this is more efficent and
easier to manage in the future.
2025-05-25 00:32:54 +02:00

38 lines
738 B
Nix

{
lib,
config,
namespace,
...
}:
with lib;
with lib.${namespace};
let
cfg = config.${namespace}.services.acme;
in
{
options.${namespace}.services.acme = {
enable = mkBoolOpt false "ACME";
};
config = mkIf cfg.enable {
security.acme = {
acceptTerms = true;
defaults.email = "admin+acme@stahl.sh";
certs."stahl.sh" = {
domain = "stahl.sh";
extraDomainNames = [ "*.stahl.sh" ];
dnsProvider = "infomaniak";
dnsPropagationCheck = true;
environmentFile = "/run/secrets/acme";
};
};
users.users.nginx.extraGroups = [ "acme" ];
sops.secrets.acme = {
format = "dotenv";
sopsFile = ../../../../secrets/blarm-acme.env;
};
};
}