Signed-off-by: cy <cy@cy7.sh>
This commit is contained in:
cy 2025-01-27 04:02:11 -05:00
parent 61b1399131
commit a9a3ee8413
Signed by: cy
SSH key fingerprint: SHA256:o/geVWV4om1QhUSkKvDQeW/eAihwnjyXkqMwrVdbuts

29
modules/caddy.nix Normal file
View file

@ -0,0 +1,29 @@
{
config,
lib,
pkgs,
...
}:
let
cfg = config.my.caddy;
commonExtraConfig = ''
encode zstd gzip
header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload"
'';
in
{
options.my.caddy = {
enable = lib.mkEnableOption "caddy reverse proxy";
acmeCa = lib.mkOption {
type = lib.types.str;
};
};
config = lib.mkIf cfg.enable {
services.caddy = {
enable = true;
logFormat = lib.mkForce "level INFO";
acmeCa = "https://acme-v02.api.letsencrypt.org/directory";
};
};
}