diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2019-01-12 12:41:23 +0100 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2019-01-12 21:59:41 +0100 |
commit | 108891744eaa7410e305871212d5b81c1b67a095 (patch) | |
tree | 90e3f1a87573532ed1c14e233ad7348904ce47f8 /virtual/modules/websites/tools/tools/default.nix | |
parent | 950ca5ee979ae2467f3471216140de2c1d572f4b (diff) | |
download | Nix-108891744eaa7410e305871212d5b81c1b67a095.tar.gz Nix-108891744eaa7410e305871212d5b81c1b67a095.tar.zst Nix-108891744eaa7410e305871212d5b81c1b67a095.zip |
Refactor websites.
This commit refactors websites into module per "vhost".
Diffstat (limited to 'virtual/modules/websites/tools/tools/default.nix')
-rw-r--r-- | virtual/modules/websites/tools/tools/default.nix | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/virtual/modules/websites/tools/tools/default.nix b/virtual/modules/websites/tools/tools/default.nix new file mode 100644 index 0000000..f29ac11 --- /dev/null +++ b/virtual/modules/websites/tools/tools/default.nix | |||
@@ -0,0 +1,65 @@ | |||
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 | |||
8 | cfg = config.services.myWebsites.tools.tools; | ||
9 | in { | ||
10 | options.services.myWebsites.tools.tools = { | ||
11 | enable = lib.mkEnableOption "enable tools website"; | ||
12 | }; | ||
13 | |||
14 | config = lib.mkIf cfg.enable { | ||
15 | security.acme.certs."eldiron".extraDomains."tools.immae.eu" = null; | ||
16 | |||
17 | services.myWebsites.tools.modules = | ||
18 | adminer.apache.modules | ||
19 | ++ ympd.apache.modules | ||
20 | ++ ttrss.apache.modules | ||
21 | ++ roundcubemail.apache.modules; | ||
22 | |||
23 | services.ympd = ympd.config // { enable = false; }; | ||
24 | |||
25 | services.myWebsites.tools.vhostConfs.tools = { | ||
26 | certName = "eldiron"; | ||
27 | hosts = ["tools.immae.eu" ]; | ||
28 | root = null; | ||
29 | extraConfig = [ | ||
30 | adminer.apache.vhostConf | ||
31 | ympd.apache.vhostConf | ||
32 | ttrss.apache.vhostConf | ||
33 | roundcubemail.apache.vhostConf | ||
34 | ]; | ||
35 | }; | ||
36 | |||
37 | services.myPhpfpm.poolConfigs = { | ||
38 | adminer = adminer.phpFpm.pool; | ||
39 | ttrss = ttrss.phpFpm.pool; | ||
40 | roundcubemail = roundcubemail.phpFpm.pool; | ||
41 | }; | ||
42 | |||
43 | system.activationScripts = { | ||
44 | ttrss = ttrss.activationScript; | ||
45 | roundcubemail = roundcubemail.activationScript; | ||
46 | }; | ||
47 | |||
48 | systemd.services.tt-rss = { | ||
49 | description = "Tiny Tiny RSS feeds update daemon"; | ||
50 | serviceConfig = { | ||
51 | User = "wwwrun"; | ||
52 | ExecStart = "${pkgs.php}/bin/php ${ttrss.webRoot}/update.php --daemon"; | ||
53 | StandardOutput = "syslog"; | ||
54 | StandardError = "syslog"; | ||
55 | PermissionsStartOnly = true; | ||
56 | }; | ||
57 | |||
58 | wantedBy = [ "multi-user.target" ]; | ||
59 | requires = ["postgresql.service"]; | ||
60 | after = ["network.target" "postgresql.service"]; | ||
61 | }; | ||
62 | |||
63 | }; | ||
64 | } | ||
65 | |||