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