Merge pull request #1178 from chexxor/fix-httpd-ssh

HTTPD: Check for SSL Cert value before building with SSL support.
This commit is contained in:
Rob Vermaas 2014-01-27 12:34:42 -08:00
commit 4ccd60af00

View file

@ -260,7 +260,7 @@ let
'' else ""} '' else ""}
${if cfg.globalRedirect != null then '' ${if cfg.globalRedirect != null && cfg.globalRedirect != "" then ''
RedirectPermanent / ${cfg.globalRedirect} RedirectPermanent / ${cfg.globalRedirect}
'' else ""} '' else ""}
@ -582,6 +582,12 @@ in
###### implementation ###### implementation
config = mkIf config.services.httpd.enable { config = mkIf config.services.httpd.enable {
assertions = [ { assertion = mainCfg.enableSSL == true
-> mainCfg.sslServerCert != null
&& mainCfg.sslServerKey != null;
message = "SSL is enabled for HTTPD, but sslServerCert and/or sslServerKey haven't been specified."; }
];
users.extraUsers = optionalAttrs (mainCfg.user == "wwwrun") singleton users.extraUsers = optionalAttrs (mainCfg.user == "wwwrun") singleton
{ name = "wwwrun"; { name = "wwwrun";