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