]> git.immae.eu Git - perso/Immae/Config/Nix.git/blobdiff - virtual/eldiron.nix
Put adminer configuration in its package
[perso/Immae/Config/Nix.git] / virtual / eldiron.nix
index 55b0bf713424cd6915e400df0a2d6608a7f3cab2..768de84c63e173bfdaea6d12e45c76763d63b306 100644 (file)
         log_level = notice
         '';
       poolConfigs = {
-        adminer = ''
-          listen = /var/run/phpfpm/adminer.sock
-          user = wwwrun
-          group = wwwrun
-          listen.owner = wwwrun
-          listen.group = wwwrun
-          pm = ondemand
-          pm.max_children = 5
-          pm.process_idle_timeout = 60
-          ;php_admin_flag[log_errors] = on
-          php_admin_value[open_basedir] = "${mypkgs.adminer}:/tmp"
-          '';
+        adminer = mypkgs.adminer.phpFpm.pool;
         www = ''
           listen = /var/run/phpfpm/www.sock
           user = wwwrun
           listen = [ { ip = "*"; port = 443; } ];
           hostName = "db-1.immae.eu";
           documentRoot = null;
-          extraConfig = ''
-            Alias /adminer ${mypkgs.adminer}
-            <Directory ${mypkgs.adminer}>
-              DirectoryIndex = index.php
-              <FilesMatch "\.php$">
-                SetHandler "proxy:unix:/var/run/phpfpm/adminer.sock|fcgi://localhost"
-              </FilesMatch>
-            </Directory>
-            '';
+          extraConfig = builtins.concatStringsSep "\n" [
+            mypkgs.adminer.apacheConf
+          ];
         })
         { # Should go last, default fallback
           listen = [ { ip = "*"; port = 80; } ];
         ];
     };
 
-    services.nginx = rec {
-      enable = false;
-      virtualHosts = {
-        "_" = {
-          serverName = "_";
-          useACMEHost = "eldiron";
-        };
-        "eldiron.immae.eu" = {
-          forceSSL = true;
-          useACMEHost = "eldiron";
-          locations."/" = {
-            # FIXME: directory needs to exist
-            root = "/var/www";
-            extraConfig = ''
-              include ${pkgs.nginx}/conf/fastcgi.conf;
-              fastcgi_split_path_info ^(.+?\.php)(/.*)$;
-              fastcgi_param HTTP_PROXY "";
-              fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-              fastcgi_pass unix:/var/run/phpfpm/www.sock;
-              fastcgi_index index.php;
-              fastcgi_intercept_errors on;
-              '';
-          };
-        };
-        "db-1.immae.eu" = {
-          forceSSL = true;
-          useACMEHost = "eldiron";
-          locations."/adminer" = {
-            alias = mypkgs.adminer;
-            index = "index.php";
-            extraConfig = ''
-              include ${pkgs.nginx}/conf/fastcgi.conf;
-              fastcgi_split_path_info ^(.+?\.php)(/.*)$;
-              fastcgi_param HTTP_PROXY "";
-              fastcgi_param SCRIPT_FILENAME ${mypkgs.adminer}/index.php;
-              fastcgi_pass unix:/var/run/phpfpm/adminer.sock;
-              fastcgi_index index.php;
-              fastcgi_intercept_errors on;
-              '';
-          };
-        };
-      };
-    };
-
     # FIXME: environment variables ?
     security.pam.services = let
       pam_ldap = pkgs.pam_ldap;
     # FIXME: backup
     # FIXME: restart after pam
     # FIXME: pam access doesn’t work (because of php module)
+    # FIXME: ssl
     services.mysql = rec {
       enable = true;
       package = pkgs.mariadb.overrideAttrs(old: rec {
 
     # FIXME: initial sync
     # FIXME: backup
+    # FIXME: ssl
     services.postgresql = rec {
       enable = true;
       package = pkgs.postgresql100.overrideAttrs(old: rec {