]> git.immae.eu Git - perso/Immae/Config/Nix.git/blame - virtual/modules/websites/tools/tools/default.nix
Fix deprecation for networking addresses in hetzner
[perso/Immae/Config/Nix.git] / virtual / modules / websites / tools / tools / default.nix
CommitLineData
10889174
IB
1{ lib, pkgs, config, mylibs, ... }:
2let
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; };
aebd817b 7 wallabag = pkgs.callPackage ./wallabag.nix { inherit (mylibs) checkEnv; };
10889174
IB
8
9 cfg = config.services.myWebsites.tools.tools;
10in {
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
aebd817b
IB
22 ++ roundcubemail.apache.modules
23 ++ wallabag.apache.modules;
10889174
IB
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
aebd817b 36 wallabag.apache.vhostConf
10889174
IB
37 ];
38 };
39
40 services.myPhpfpm.poolConfigs = {
41 adminer = adminer.phpFpm.pool;
42 ttrss = ttrss.phpFpm.pool;
43 roundcubemail = roundcubemail.phpFpm.pool;
aebd817b 44 wallabag = wallabag.phpFpm.pool;
10889174
IB
45 };
46
47 system.activationScripts = {
48 ttrss = ttrss.activationScript;
49 roundcubemail = roundcubemail.activationScript;
aebd817b 50 wallabag = wallabag.activationScript;
10889174
IB
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