1 { lib, pkgs, config, myconfig, mylibs, ... }:
3 adminer = pkgs.callPackage ../../commons/adminer.nix {};
4 ympd = pkgs.callPackage ./ympd.nix {
5 env = myconfig.env.tools.ympd;
7 ttrss = pkgs.callPackage ./ttrss.nix {
8 inherit (mylibs) fetchedGithub fetchedGit;
9 env = myconfig.env.tools.ttrss;
11 roundcubemail = pkgs.callPackage ./roundcubemail.nix { env = myconfig.env.tools.roundcubemail; };
12 rainloop = pkgs.callPackage ./rainloop.nix {};
13 kanboard = pkgs.callPackage ./kanboard.nix {
14 inherit (mylibs) fetchedGithub;
15 env = myconfig.env.tools.kanboard;
17 wallabag = pkgs.callPackage ./wallabag.nix { env = myconfig.env.tools.wallabag; };
18 yourls = pkgs.callPackage ./yourls.nix {
19 inherit (mylibs) fetchedGithub;
20 env = myconfig.env.tools.yourls;
22 rompr = pkgs.callPackage ./rompr.nix {
23 inherit (mylibs) fetchedGithub;
24 env = myconfig.env.tools.rompr;
26 shaarli = pkgs.callPackage ./shaarli.nix {
27 env = myconfig.env.tools.shaarli;
29 dokuwiki = pkgs.callPackage ./dokuwiki.nix {
30 inherit (mylibs) fetchedGithub;
32 ldap = pkgs.callPackage ./ldap.nix {
33 env = myconfig.env.tools.phpldapadmin;
36 cfg = config.services.myWebsites.tools.tools;
38 options.services.myWebsites.tools.tools = {
39 enable = lib.mkEnableOption "enable tools website";
42 config = lib.mkIf cfg.enable {
43 security.acme.certs."eldiron".extraDomains."tools.immae.eu" = null;
44 security.acme.certs."eldiron".extraDomains."devtools.immae.eu" = null;
46 services.myWebsites.integration.modules =
47 rainloop.apache.modules;
49 services.myWebsites.tools.modules =
51 ++ adminer.apache.modules
52 ++ ympd.apache.modules
53 ++ ttrss.apache.modules
54 ++ roundcubemail.apache.modules
55 ++ wallabag.apache.modules
56 ++ yourls.apache.modules
57 ++ rompr.apache.modules
58 ++ shaarli.apache.modules
59 ++ dokuwiki.apache.modules
60 ++ ldap.apache.modules
61 ++ kanboard.apache.modules;
63 services.ympd = ympd.config // { enable = true; };
65 services.myWebsites.integration.vhostConfs.devtools = {
67 hosts = ["devtools.immae.eu" ];
70 rainloop.apache.vhostConf
74 services.myWebsites.tools.vhostConfs.tools = {
76 hosts = ["tools.immae.eu" ];
77 root = "/var/lib/ftp/tools.immae.eu";
80 <Directory "/var/lib/ftp/tools.immae.eu">
81 DirectoryIndex index.php index.htm index.html
85 SetHandler "proxy:unix:/var/run/phpfpm/tools.sock|fcgi://localhost"
89 adminer.apache.vhostConf
91 ttrss.apache.vhostConf
92 roundcubemail.apache.vhostConf
93 wallabag.apache.vhostConf
94 yourls.apache.vhostConf
95 rompr.apache.vhostConf
96 shaarli.apache.vhostConf
97 dokuwiki.apache.vhostConf
99 kanboard.apache.vhostConf
103 security.acme.certs."eldiron".extraDomains."outils.immae.eu" = null;
104 services.myWebsites.tools.vhostConfs.outils = {
105 certName = "eldiron";
106 hosts = [ "outils.immae.eu" ];
110 RedirectMatch 301 ^/mediagoblin(.*)$ https://mgoblin.immae.eu$1
112 RedirectMatch 301 ^/ether(.*)$ https://ether.immae.eu$1
114 RedirectMatch 301 ^/nextcloud(.*)$ https://cloud.immae.eu$1
115 RedirectMatch 301 ^/owncloud(.*)$ https://cloud.immae.eu$1
117 RedirectMatch 301 ^/carddavmate(.*)$ https://dav.immae.eu/infcloud$1
118 RedirectMatch 301 ^/caldavzap(.*)$ https://dav.immae.eu/infcloud$1
119 RedirectMatch 301 ^/caldav.php(.*)$ https://dav.immae.eu/caldav.php$1
120 RedirectMatch 301 ^/davical(.*)$ https://dav.immae.eu/davical$1
122 RedirectMatch 301 ^/taskweb(.*)$ https://task.immae.eu/taskweb$1
124 RedirectMatch 301 ^/(.*)$ https://tools.immae.eu/$1
129 services.myPhpfpm.poolConfigs = {
130 adminer = adminer.phpFpm.pool;
131 ttrss = ttrss.phpFpm.pool;
132 roundcubemail = roundcubemail.phpFpm.pool;
133 wallabag = wallabag.phpFpm.pool;
134 yourls = yourls.phpFpm.pool;
135 rompr = rompr.phpFpm.pool;
136 shaarli = shaarli.phpFpm.pool;
137 dokuwiki = dokuwiki.phpFpm.pool;
138 ldap = ldap.phpFpm.pool;
139 rainloop = rainloop.phpFpm.pool;
140 kanboard = kanboard.phpFpm.pool;
142 listen = /var/run/phpfpm/tools.sock
145 listen.owner = wwwrun
146 listen.group = wwwrun
150 pm.min_spare_servers = 1
151 pm.max_spare_servers = 10
153 ; Needed to avoid clashes in browser cookies (same domain)
154 php_value[session.name] = ToolsPHPSESSID
155 php_admin_value[open_basedir] = "/run/wrappers/bin/sendmail:/var/lib/ftp/tools.immae.eu:/tmp"
159 system.activationScripts = {
160 ttrss = ttrss.activationScript;
161 roundcubemail = roundcubemail.activationScript;
162 wallabag = wallabag.activationScript;
163 yourls = yourls.activationScript;
164 rompr = rompr.activationScript;
165 shaarli = shaarli.activationScript;
166 dokuwiki = dokuwiki.activationScript;
167 rainloop = rainloop.activationScript;
168 kanboard = kanboard.activationScript;
171 system.extraSystemBuilderCmds = ''
172 mkdir -p $out/webapps
173 ln -s ${dokuwiki.webRoot} $out/webapps/${dokuwiki.apache.webappName}
174 ln -s ${ldap.webRoot}/htdocs $out/webapps/${ldap.apache.webappName}
175 ln -s ${rompr.webRoot} $out/webapps/${rompr.apache.webappName}
176 ln -s ${roundcubemail.webRoot} $out/webapps/${roundcubemail.apache.webappName}
177 ln -s ${shaarli.webRoot} $out/webapps/${shaarli.apache.webappName}
178 ln -s ${ttrss.webRoot} $out/webapps/${ttrss.apache.webappName}
179 ln -s ${wallabag.webRoot} $out/webapps/${wallabag.apache.webappName}
180 ln -s ${yourls.webRoot} $out/webapps/${yourls.apache.webappName}
181 ln -s ${rainloop.webRoot} $out/webapps/${rainloop.apache.webappName}
182 ln -s ${kanboard.webRoot} $out/webapps/${kanboard.apache.webappName}
185 nixpkgs.overlays = [ (self: super: rec {
186 ympd = super.ympd.overrideAttrs(old: mylibs.fetchedGithub ./ympd.json);
189 systemd.services.tt-rss = {
190 description = "Tiny Tiny RSS feeds update daemon";
193 ExecStart = "${pkgs.php}/bin/php ${ttrss.webRoot}/update.php --daemon";
194 StandardOutput = "syslog";
195 StandardError = "syslog";
196 PermissionsStartOnly = true;
199 wantedBy = [ "multi-user.target" ];
200 requires = ["postgresql.service"];
201 after = ["network.target" "postgresql.service"];