--- /dev/null
+{ lib, pkgs, config, mylibs, ... }:
+let
+ adminer = pkgs.callPackage ../../commons/adminer.nix {};
+ ympd = pkgs.callPackage ./ympd.nix {};
+ ttrss = pkgs.callPackage ./ttrss.nix { inherit (mylibs) checkEnv fetchedGithub fetchedGit; };
+ roundcubemail = pkgs.callPackage ./roundcubemail.nix { inherit (mylibs) checkEnv; };
+
+ cfg = config.services.myWebsites.tools.tools;
+in {
+ options.services.myWebsites.tools.tools = {
+ enable = lib.mkEnableOption "enable tools website";
+ };
+
+ config = lib.mkIf cfg.enable {
+ security.acme.certs."eldiron".extraDomains."tools.immae.eu" = null;
+
+ services.myWebsites.tools.modules =
+ adminer.apache.modules
+ ++ ympd.apache.modules
+ ++ ttrss.apache.modules
+ ++ roundcubemail.apache.modules;
+
+ services.ympd = ympd.config // { enable = false; };
+
+ services.myWebsites.tools.vhostConfs.tools = {
+ certName = "eldiron";
+ hosts = ["tools.immae.eu" ];
+ root = null;
+ extraConfig = [
+ adminer.apache.vhostConf
+ ympd.apache.vhostConf
+ ttrss.apache.vhostConf
+ roundcubemail.apache.vhostConf
+ ];
+ };
+
+ services.myPhpfpm.poolConfigs = {
+ adminer = adminer.phpFpm.pool;
+ ttrss = ttrss.phpFpm.pool;
+ roundcubemail = roundcubemail.phpFpm.pool;
+ };
+
+ system.activationScripts = {
+ ttrss = ttrss.activationScript;
+ roundcubemail = roundcubemail.activationScript;
+ };
+
+ systemd.services.tt-rss = {
+ description = "Tiny Tiny RSS feeds update daemon";
+ serviceConfig = {
+ User = "wwwrun";
+ ExecStart = "${pkgs.php}/bin/php ${ttrss.webRoot}/update.php --daemon";
+ StandardOutput = "syslog";
+ StandardError = "syslog";
+ PermissionsStartOnly = true;
+ };
+
+ wantedBy = [ "multi-user.target" ];
+ requires = ["postgresql.service"];
+ after = ["network.target" "postgresql.service"];
+ };
+
+ };
+}
+