enable ssl

This commit is contained in:
Anish Lakhwara 2022-09-20 19:21:22 +10:00
parent 50f7ee786d
commit 36bda6965a

View file

@ -69,6 +69,7 @@
serviceConfig = config.services."${serverName}"; serviceConfig = config.services."${serverName}";
options = { options = {
enable = lib.mkEnableOption "${serverName} service"; enable = lib.mkEnableOption "${serverName} service";
enableSSL = lib.mkEnableOption "${serverName} SSL for Nginx";
}; };
in in
{ {
@ -95,8 +96,8 @@
networking.firewall.allowedTCPPorts = [ 80 ]; networking.firewall.allowedTCPPorts = [ 80 ];
services.nginx.enable = true; services.nginx.enable = true;
services.nginx.virtualHosts.${serverName} = { services.nginx.virtualHosts.${serverName} = {
#forceSSL = true; forceSSL = serviceConfig.enableSSL;
enableACME = true; enableACME = serviceConfig.enableSSL;
locations."/" = { root = "${webRoot}${serverName}"; index = "/home.html"; }; locations."/" = { root = "${webRoot}${serverName}"; index = "/home.html"; };
}; };
}; };