]> git.immae.eu Git - perso/Immae/Config/Nix.git/blob - virtual/modules/websites/tools/tools/default.nix
294959c72455c50138426845d58d3a434817dd99
[perso/Immae/Config/Nix.git] / virtual / modules / websites / tools / tools / default.nix
1 { lib, pkgs, config, myconfig, mylibs, ... }:
2 let
3 adminer = pkgs.callPackage ../../commons/adminer.nix {};
4 ympd = pkgs.callPackage ./ympd.nix {};
5 ttrss = pkgs.callPackage ./ttrss.nix {
6 inherit (mylibs) fetchedGithub fetchedGit;
7 env = myconfig.env.tools.ttrss;
8 };
9 roundcubemail = pkgs.callPackage ./roundcubemail.nix { env = myconfig.env.tools.roundcubemail; };
10 wallabag = pkgs.callPackage ./wallabag.nix { env = myconfig.env.tools.wallabag; };
11
12 cfg = config.services.myWebsites.tools.tools;
13 in {
14 options.services.myWebsites.tools.tools = {
15 enable = lib.mkEnableOption "enable tools website";
16 };
17
18 config = lib.mkIf cfg.enable {
19 security.acme.certs."eldiron".extraDomains."tools.immae.eu" = null;
20
21 services.myWebsites.tools.modules =
22 adminer.apache.modules
23 ++ ympd.apache.modules
24 ++ ttrss.apache.modules
25 ++ roundcubemail.apache.modules
26 ++ wallabag.apache.modules;
27
28 services.ympd = ympd.config // { enable = false; };
29
30 services.myWebsites.tools.vhostConfs.tools = {
31 certName = "eldiron";
32 hosts = ["tools.immae.eu" ];
33 root = null;
34 extraConfig = [
35 adminer.apache.vhostConf
36 ympd.apache.vhostConf
37 ttrss.apache.vhostConf
38 roundcubemail.apache.vhostConf
39 wallabag.apache.vhostConf
40 ];
41 };
42
43 services.myPhpfpm.poolConfigs = {
44 adminer = adminer.phpFpm.pool;
45 ttrss = ttrss.phpFpm.pool;
46 roundcubemail = roundcubemail.phpFpm.pool;
47 wallabag = wallabag.phpFpm.pool;
48 };
49
50 system.activationScripts = {
51 ttrss = ttrss.activationScript;
52 roundcubemail = roundcubemail.activationScript;
53 wallabag = wallabag.activationScript;
54 };
55
56 systemd.services.tt-rss = {
57 description = "Tiny Tiny RSS feeds update daemon";
58 serviceConfig = {
59 User = "wwwrun";
60 ExecStart = "${pkgs.php}/bin/php ${ttrss.webRoot}/update.php --daemon";
61 StandardOutput = "syslog";
62 StandardError = "syslog";
63 PermissionsStartOnly = true;
64 };
65
66 wantedBy = [ "multi-user.target" ];
67 requires = ["postgresql.service"];
68 after = ["network.target" "postgresql.service"];
69 };
70
71 };
72 }
73