init
Signed-off-by: cy <cy@cy7.sh>
This commit is contained in:
parent
61b1399131
commit
a9a3ee8413
1 changed files with 29 additions and 0 deletions
29
modules/caddy.nix
Normal file
29
modules/caddy.nix
Normal 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";
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Reference in a new issue