]> git.immae.eu Git - perso/Immae/Config/Nix.git/blobdiff - modules/private/websites/default.nix
Remove webappdirs
[perso/Immae/Config/Nix.git] / modules / private / websites / default.nix
index 809f6159eb0dd035335af198557faf4402bb2798..08c9d7907602a2d0866d561c8d0f4968a8799c1a 100644 (file)
@@ -1,7 +1,7 @@
 { lib, pkgs, config, ... }:
 let
-  www_root = "/run/current-system/webapps/_www";
-  theme_root = "/run/current-system/webapps/_theme";
+  www_root = ./_www;
+  theme_root = pkgs.webapps.apache-theme.theme;
   apacheConfig = {
     cache = {
       # This setting permits to ignore time-based cache for files in the
@@ -52,7 +52,7 @@ let
           LDAPOpCacheTTL 600
         </IfModule>
 
-        Include /var/secrets/apache-ldap
+        Include ${config.secrets.fullPaths."apache-ldap"}
       '';
     };
     global = {
@@ -109,8 +109,7 @@ in
     users.users.wwwrun.extraGroups = [ "keys" ];
     networking.firewall.allowedTCPPorts = [ 80 443 ];
 
-    secrets.keys = [{
-      dest = "apache-ldap";
+    secrets.keys."apache-ldap" = {
       user = "wwwrun";
       group = "wwwrun";
       permissions = "0400";
@@ -126,7 +125,7 @@ in
           </IfModule>
         </Macro>
         '';
-    }];
+    };
 
     system.activationScripts = {
       httpd = ''
@@ -149,9 +148,9 @@ in
       };
     };
 
-    services.filesWatcher.httpdProd.paths = [ "/var/secrets/apache-ldap" ];
-    services.filesWatcher.httpdInte.paths = [ "/var/secrets/apache-ldap" ];
-    services.filesWatcher.httpdTools.paths = [ "/var/secrets/apache-ldap" ];
+    services.filesWatcher.httpdProd.paths = [ config.secrets.fullPaths."apache-ldap" ];
+    services.filesWatcher.httpdInte.paths = [ config.secrets.fullPaths."apache-ldap" ];
+    services.filesWatcher.httpdTools.paths = [ config.secrets.fullPaths."apache-ldap" ];
 
     services.websites.env.production = {
       enable = true;
@@ -217,10 +216,6 @@ in
       };
     };
 
-    services.websites.webappDirs = {
-      _www = ./_www;
-      _theme = pkgs.webapps.apache-theme.theme;
-    };
     myServices.websites = {
       bakeer.cloud.enable = true;
       capitaines.landing_pages.enable = true;