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