]>
Commit | Line | Data |
---|---|---|
3013caf1 IB |
1 | { lib, pkgs, config, mylibs, ... }: |
2 | let | |
86f6924f IB |
3 | aten = pkgs.callPackage ../../packages/aten.nix { inherit (mylibs) checkEnv fetchedGitPrivate; }; |
4 | aten_dev = aten { environment = "dev"; }; | |
5 | aten_prod = aten { environment = "prod"; }; | |
6 | ||
3013caf1 IB |
7 | cfg = config.services.myWebsites.Aten; |
8 | in { | |
9 | options.services.myWebsites.Aten = { | |
10 | production = { | |
11 | enable = lib.mkEnableOption "enable Aten's website in production"; | |
12 | }; | |
13 | integration = { | |
14 | enable = lib.mkEnableOption "enable Aten's website in integration"; | |
15 | }; | |
16 | }; | |
17 | ||
18 | config = lib.mkMerge [ | |
19 | (lib.mkIf cfg.production.enable { | |
e4a945cd IB |
20 | services.myWebsites.commons.stats.enable = true; |
21 | services.myWebsites.commons.stats.sites = [ | |
22 | { | |
23 | name = "aten.pro"; | |
24 | conf = ../../packages/aten_goaccess.conf; | |
25 | } | |
26 | ]; | |
27 | ||
3013caf1 IB |
28 | security.acme.certs."aten" = config.services.myCertificates.certConfig // { |
29 | domain = "aten.pro"; | |
30 | extraDomains = { | |
31 | "www.aten.pro" = null; | |
32 | }; | |
33 | }; | |
86f6924f IB |
34 | |
35 | services.phpfpm.poolConfigs.aten_prod = aten_prod.phpFpm.pool; | |
36 | system.activationScripts.aten_prod = aten_prod.activationScript; | |
42429ef0 | 37 | services.myWebsites.apacheConfig.aten_prod.modules = aten_prod.apache.modules; |
f8bde3d6 IB |
38 | services.myWebsites.production.modules = aten_prod.apache.modules; |
39 | services.myWebsites.production.vhostConfs.aten = { | |
40 | certName = "aten"; | |
41 | hosts = [ "aten.pro" "www.aten.pro" ]; | |
42 | root = aten_prod.webRoot; | |
43 | extraConfig = [ aten_prod.apache.vhostConf ]; | |
44 | }; | |
3013caf1 IB |
45 | }) |
46 | (lib.mkIf cfg.integration.enable { | |
47 | security.acme.certs."eldiron".extraDomains."dev.aten.pro" = null; | |
86f6924f IB |
48 | services.phpfpm.poolConfigs.aten_dev = aten_dev.phpFpm.pool; |
49 | system.activationScripts.aten_dev = aten_dev.activationScript; | |
f8bde3d6 IB |
50 | services.myWebsites.integration.modules = aten_dev.apache.modules; |
51 | services.myWebsites.integration.vhostConfs.aten = { | |
52 | certName = "eldiron"; | |
53 | hosts = [ "dev.aten.pro" ]; | |
54 | root = aten_dev.webRoot; | |
55 | extraConfig = [ aten_dev.apache.vhostConf ]; | |
56 | }; | |
3013caf1 IB |
57 | }) |
58 | ]; | |
59 | } | |
60 |