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