mailsystem: Add nginx configuration to retrieve letsencrypt certificate
This commit is contained in:
parent
77e4cac42d
commit
3943ec3356
2 changed files with 41 additions and 0 deletions
20
mailsystem/nginx.nix
Normal file
20
mailsystem/nginx.nix
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
cfg = config.mailsystem;
|
||||
in {
|
||||
config = lib.mkIf cfg.enable {
|
||||
services.nginx = {
|
||||
enable = true;
|
||||
virtualHosts."${cfg.fqdn}" = {
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
};
|
||||
};
|
||||
|
||||
networking.firewall.allowedTCPPorts = lib.optionals cfg.openFirewall [80 443];
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue