]>
Commit | Line | Data |
---|---|---|
f8026b6e IB |
1 | { lib, pkgs, config, myconfig, ... }: |
2 | let | |
3 | aten = pkgs.callPackage ./builder.nix { | |
4 | inherit (pkgs.webapps) aten; | |
5 | config = myconfig.env.websites.aten.production; | |
6 | apacheUser = config.services.httpd.Prod.user; | |
7 | apacheGroup = config.services.httpd.Prod.group; | |
8 | }; | |
9 | ||
10 | cfg = config.myServices.websites.aten.production; | |
11 | in { | |
12 | options.myServices.websites.aten.production.enable = lib.mkEnableOption "enable Aten's website in production"; | |
13 | ||
14 | config = lib.mkIf cfg.enable { | |
15 | secrets.keys = aten.keys; | |
16 | services.webstats.sites = [ { name = "aten.pro"; } ]; | |
17 | ||
f40f5b23 IB |
18 | systemd.services.phpfpm-aten_prod.preStart = lib.mkAfter aten.phpFpm.preStart; |
19 | systemd.services.phpfpm-aten_prod.after = lib.mkAfter aten.phpFpm.serviceDeps; | |
20 | systemd.services.phpfpm-aten_prod.wants = aten.phpFpm.serviceDeps; | |
21 | services.phpfpm.poolConfigs.aten_prod = aten.phpFpm.pool; | |
f8026b6e IB |
22 | system.activationScripts.aten_prod = aten.activationScript; |
23 | system.extraSystemBuilderCmds = '' | |
24 | mkdir -p $out/webapps | |
25 | ln -s ${aten.app.webRoot} $out/webapps/${aten.apache.webappName} | |
26 | ''; | |
27 | services.websites.production.modules = aten.apache.modules; | |
28 | services.websites.production.vhostConfs.aten = { | |
29 | certName = "aten"; | |
30 | certMainHost = "aten.pro"; | |
31 | hosts = [ "aten.pro" "www.aten.pro" ]; | |
32 | root = aten.apache.root; | |
33 | extraConfig = [ aten.apache.vhostConf ]; | |
34 | }; | |
35 | }; | |
36 | } | |
37 |