./aten
./piedsjaloux
./connexionswing
+ ./tellesflorian
+ ./tools/db
+ ./tools/tools
+ ./tools/dav
+ ./tools/cloud
+ ./tools/git
+ ./tools/mastodon
# built using:
# sed -e "s/services\.httpd/services\.httpdProd/g" .nix-defexpr/channels/nixpkgs/nixos/modules/services/web-servers/apache-httpd/default.nix
# And removed users / groups
./apache/httpd_prod.nix
./apache/httpd_inte.nix
+ # Adapted from base phpfpm
+ ./phpfpm
];
options.services.myWebsites = {
phpPackages = oldpkgs.php72Packages.override { inherit php; };
};
+ services.myWebsites.tools.databases.enable = true;
+ services.myWebsites.tools.tools.enable = true;
+ services.myWebsites.tools.dav.enable = true;
+ services.myWebsites.tools.cloud.enable = true;
+ services.myWebsites.tools.git.enable = true;
+ services.myWebsites.tools.mastodon.enable = true;
+
services.myWebsites.Chloe.production.enable = cfg.production.enable;
services.myWebsites.Ludivine.production.enable = cfg.production.enable;
services.myWebsites.Aten.production.enable = cfg.production.enable;
services.myWebsites.Aten.integration.enable = cfg.integration.enable;
services.myWebsites.PiedsJaloux.integration.enable = cfg.integration.enable;
services.myWebsites.Connexionswing.integration.enable = cfg.integration.enable;
+ services.myWebsites.TellesFlorian.integration.enable = true;
services.myWebsites.apacheConfig = {
gzip = {
};
};
+ system.activationScripts = {
+ httpd = ''
+ install -d -m 0755 /var/lib/acme/acme-challenge
+ install -d -m 0750 -o wwwrun -g wwwrun /var/lib/php/sessions
+ install -d -m 0750 -o wwwrun -g wwwrun /var/lib/php/sessions/adminer
+ install -d -m 0750 -o wwwrun -g wwwrun /var/lib/php/sessions/mantisbt
+ install -d -m 0750 -o wwwrun -g wwwrun /var/lib/php/sessions/davical
+ '';
+ };
+
+ services.myPhpfpm = {
+ phpPackage = pkgs.php;
+ phpOptions = ''
+ session.save_path = "/var/lib/php/sessions"
+ session.gc_maxlifetime = 60*60*24*15
+ session.cache_expire = 60*24*30
+ '';
+ extraConfig = ''
+ log_level = notice
+ '';
+ };
+
# FIXME: logrotate
# FIXME: ipv6
services.httpdProd = makeService "production" config.services.myWebsites.production;
services.myWebsites.integration.extraConfig = (builtins.filter (x: x != null) (pkgs.lib.attrsets.mapAttrsToList (n: v: v.extraConfig or null) cfg.apacheConfig));
services.httpd = makeService "tools" config.services.myWebsites.tools;
- services.myWebsites.tools.modules =
- mypkgs.adminer.apache.modules ++
- mypkgs.nextcloud.apache.modules ++
- mypkgs.ympd.apache.modules ++
- mypkgs.mantisbt.apache.modules ++
- mypkgs.ttrss.apache.modules ++
- mypkgs.roundcubemail.apache.modules ++
- pkgs.lib.lists.flatten (pkgs.lib.attrsets.mapAttrsToList (n: v: v.modules or []) cfg.apacheConfig);
+ services.myWebsites.tools.modules = pkgs.lib.lists.flatten (pkgs.lib.attrsets.mapAttrsToList (n: v: v.modules or []) cfg.apacheConfig);
services.myWebsites.tools.extraConfig = (builtins.filter (x: x != null) (pkgs.lib.attrsets.mapAttrsToList (n: v: v.extraConfig or null) cfg.apacheConfig));
- # FIXME: move them all to separate modules
- services.myWebsites.tools.vhostConfs.eldiron = {
- certName = "eldiron";
- hosts = ["eldiron.immae.eu" ];
- root = ../../www;
- extraConfig = [ "DirectoryIndex index.htm" ];
- };
- services.myWebsites.tools.vhostConfs.db-1 = {
- certName = "eldiron";
- hosts = ["db-1.immae.eu" ];
- root = null;
- extraConfig = [ mypkgs.adminer.apache.vhostConf ];
- };
- services.myWebsites.tools.vhostConfs.tools = {
- certName = "eldiron";
- hosts = ["tools.immae.eu" ];
- root = null;
- extraConfig = [
- mypkgs.adminer.apache.vhostConf
- mypkgs.ympd.apache.vhostConf
- mypkgs.ttrss.apache.vhostConf
- mypkgs.roundcubemail.apache.vhostConf
- ];
- };
- services.myWebsites.tools.vhostConfs.dav = {
- certName = "eldiron";
- hosts = ["dav.immae.eu" ];
- root = null;
- extraConfig = [
- mypkgs.infcloud.apache.vhostConf
- mypkgs.davical.apache.vhostConf
- ];
- };
- services.myWebsites.tools.vhostConfs.cloud = {
- certName = "eldiron";
- hosts = ["cloud.immae.eu" ];
- root = mypkgs.nextcloud.webRoot;
- extraConfig = [
- mypkgs.nextcloud.apache.vhostConf
- ];
- };
- services.myWebsites.tools.vhostConfs.git.extraConfig = [
- mypkgs.mantisbt.apache.vhostConf
- ''
- RewriteEngine on
- RewriteCond %{REQUEST_URI} ^/releases
- RewriteRule /releases(.*) https://release.immae.eu$1 [P,L]
- ''
- ];
};
}