1
0
Fork 0

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.
This commit is contained in:
Philipp 2025-05-25 00:32:54 +02:00
parent 7dd87536aa
commit 5792e478af
Signed by: Philipp
GPG key ID: 9EBD8439AFBAB750
9 changed files with 244 additions and 74 deletions

View file

@ -0,0 +1,38 @@
{
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;
};
};
}