summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorAlex Berg <chexxor@gmail.com>2013-11-06 09:32:22 +0800
committerAlex Berg <chexxor@gmail.com>2013-11-06 11:20:14 +0800
commit0427e7fbf236ca20e9311399dd3e7d369e6a99c6 (patch)
treeaef0718cb3064e0329d07595eb363319fbab4cc0 /nixos
parent9817bada91cb5b69ecaa8cf3ae393cc50a289881 (diff)
downloadnixpkgs-0427e7fbf236ca20e9311399dd3e7d369e6a99c6.tar
nixpkgs-0427e7fbf236ca20e9311399dd3e7d369e6a99c6.tar.gz
nixpkgs-0427e7fbf236ca20e9311399dd3e7d369e6a99c6.tar.bz2
nixpkgs-0427e7fbf236ca20e9311399dd3e7d369e6a99c6.tar.lz
nixpkgs-0427e7fbf236ca20e9311399dd3e7d369e6a99c6.tar.xz
nixpkgs-0427e7fbf236ca20e9311399dd3e7d369e6a99c6.tar.zst
nixpkgs-0427e7fbf236ca20e9311399dd3e7d369e6a99c6.zip
Check for SSL Cert value before building with SSL support.
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/services/web-servers/apache-httpd/default.nix6
1 files changed, 6 insertions, 0 deletions
diff --git a/nixos/modules/services/web-servers/apache-httpd/default.nix b/nixos/modules/services/web-servers/apache-httpd/default.nix
index d21b6da0e77..e94af76661d 100644
--- a/nixos/modules/services/web-servers/apache-httpd/default.nix
+++ b/nixos/modules/services/web-servers/apache-httpd/default.nix
@@ -582,6 +582,12 @@ in
   ###### implementation
 
   config = mkIf config.services.httpd.enable {
+  
+    assertions = [ { assertion = mainCfg.enableSSL == true
+                               -> mainCfg.sslServerCert != null && mainCfg.sslServerCert != ""
+                                    && mainCfg.sslServerKey != null && mainCfg.sslServerKey != "";
+                     message = "SSL is enabled for HTTPD, but sslServerCert and/or sslServerKey haven't been specified."; }
+                 ];
 
     users.extraUsers = optionalAttrs (mainCfg.user == "wwwrun") singleton
       { name = "wwwrun";