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 kanboard = pkgs.callPackage ./kanboard.nix {
13 inherit (mylibs) fetchedGithub;
14 env = myconfig.env.tools.kanboard;
16 wallabag = pkgs.callPackage ./wallabag.nix { env = myconfig.env.tools.wallabag; };
17 yourls = pkgs.callPackage ./yourls.nix {
18 inherit (mylibs) fetchedGithub;
19 env = myconfig.env.tools.yourls;
21 rompr = pkgs.callPackage ./rompr.nix {
22 inherit (mylibs) fetchedGithub;
23 env = myconfig.env.tools.rompr;
25 shaarli = pkgs.callPackage ./shaarli.nix {
26 env = myconfig.env.tools.shaarli;
28 dokuwiki = pkgs.callPackage ./dokuwiki.nix {
29 inherit (mylibs) fetchedGithub;
31 ldap = pkgs.callPackage ./ldap.nix {
32 env = myconfig.env.tools.phpldapadmin;
35 cfg = config.services.myWebsites.tools.tools;
37 options.services.myWebsites.tools.tools = {
38 enable = lib.mkEnableOption "enable tools website";
41 config = lib.mkIf cfg.enable {
42 security.acme.certs."eldiron".extraDomains."tools.immae.eu" = null;
44 services.myWebsites.tools.modules =
46 ++ adminer.apache.modules
47 ++ ympd.apache.modules
48 ++ ttrss.apache.modules
49 ++ roundcubemail.apache.modules
50 ++ wallabag.apache.modules
51 ++ yourls.apache.modules
52 ++ rompr.apache.modules
53 ++ shaarli.apache.modules
54 ++ dokuwiki.apache.modules
55 ++ ldap.apache.modules
56 ++ kanboard.apache.modules;
58 services.ympd = ympd.config // { enable = true; };
60 services.myWebsites.tools.vhostConfs.tools = {
62 hosts = ["tools.immae.eu" ];
63 root = "/var/lib/ftp/tools.immae.eu";
66 <Directory "/var/lib/ftp/tools.immae.eu">
67 DirectoryIndex index.php index.htm index.html
71 SetHandler "proxy:unix:/var/run/phpfpm/tools.sock|fcgi://localhost"
75 adminer.apache.vhostConf
77 ttrss.apache.vhostConf
78 roundcubemail.apache.vhostConf
79 wallabag.apache.vhostConf
80 yourls.apache.vhostConf
81 rompr.apache.vhostConf
82 shaarli.apache.vhostConf
83 dokuwiki.apache.vhostConf
85 kanboard.apache.vhostConf
89 security.acme.certs."eldiron".extraDomains."outils.immae.eu" = null;
90 services.myWebsites.tools.vhostConfs.outils = {
92 hosts = [ "outils.immae.eu" ];
96 RedirectMatch 301 ^/mediagoblin(.*)$ https://mgoblin.immae.eu$1
98 RedirectMatch 301 ^/ether(.*)$ https://ether.immae.eu$1
100 RedirectMatch 301 ^/nextcloud(.*)$ https://cloud.immae.eu$1
101 RedirectMatch 301 ^/owncloud(.*)$ https://cloud.immae.eu$1
103 RedirectMatch 301 ^/carddavmate(.*)$ https://dav.immae.eu/infcloud$1
104 RedirectMatch 301 ^/caldavzap(.*)$ https://dav.immae.eu/infcloud$1
105 RedirectMatch 301 ^/caldav.php(.*)$ https://dav.immae.eu/caldav.php$1
106 RedirectMatch 301 ^/davical(.*)$ https://dav.immae.eu/davical$1
108 RedirectMatch 301 ^/taskweb(.*)$ https://task.immae.eu/taskweb$1
110 RedirectMatch 301 ^/(.*)$ https://tools.immae.eu/$1
115 services.myPhpfpm.poolConfigs = {
116 adminer = adminer.phpFpm.pool;
117 ttrss = ttrss.phpFpm.pool;
118 roundcubemail = roundcubemail.phpFpm.pool;
119 wallabag = wallabag.phpFpm.pool;
120 yourls = yourls.phpFpm.pool;
121 rompr = rompr.phpFpm.pool;
122 shaarli = shaarli.phpFpm.pool;
123 dokuwiki = dokuwiki.phpFpm.pool;
124 ldap = ldap.phpFpm.pool;
125 kanboard = kanboard.phpFpm.pool;
127 listen = /var/run/phpfpm/tools.sock
130 listen.owner = wwwrun
131 listen.group = wwwrun
135 pm.min_spare_servers = 1
136 pm.max_spare_servers = 10
138 ; Needed to avoid clashes in browser cookies (same domain)
139 php_value[session.name] = ToolsPHPSESSID
140 php_admin_value[open_basedir] = "/run/wrappers/bin/sendmail:/var/lib/ftp/tools.immae.eu:/tmp"
144 system.activationScripts = {
145 ttrss = ttrss.activationScript;
146 roundcubemail = roundcubemail.activationScript;
147 wallabag = wallabag.activationScript;
148 yourls = yourls.activationScript;
149 rompr = rompr.activationScript;
150 shaarli = shaarli.activationScript;
151 dokuwiki = dokuwiki.activationScript;
152 kanboard = kanboard.activationScript;
155 system.extraSystemBuilderCmds = ''
156 mkdir -p $out/webapps
157 ln -s ${dokuwiki.webRoot} $out/webapps/${dokuwiki.apache.webappName}
158 ln -s ${ldap.webRoot}/htdocs $out/webapps/${ldap.apache.webappName}
159 ln -s ${rompr.webRoot} $out/webapps/${rompr.apache.webappName}
160 ln -s ${roundcubemail.webRoot} $out/webapps/${roundcubemail.apache.webappName}
161 ln -s ${shaarli.webRoot} $out/webapps/${shaarli.apache.webappName}
162 ln -s ${ttrss.webRoot} $out/webapps/${ttrss.apache.webappName}
163 ln -s ${wallabag.webRoot} $out/webapps/${wallabag.apache.webappName}
164 ln -s ${yourls.webRoot} $out/webapps/${yourls.apache.webappName}
165 ln -s ${kanboard.webRoot} $out/webapps/${kanboard.apache.webappName}
168 nixpkgs.overlays = [ (self: super: rec {
169 ympd = super.ympd.overrideAttrs(old: mylibs.fetchedGithub ./ympd.json);
172 systemd.services.tt-rss = {
173 description = "Tiny Tiny RSS feeds update daemon";
176 ExecStart = "${pkgs.php}/bin/php ${ttrss.webRoot}/update.php --daemon";
177 StandardOutput = "syslog";
178 StandardError = "syslog";
179 PermissionsStartOnly = true;
182 wantedBy = [ "multi-user.target" ];
183 requires = ["postgresql.service"];
184 after = ["network.target" "postgresql.service"];