]>
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 { | |
20 | security.acme.certs."aten" = config.services.myCertificates.certConfig // { | |
21 | domain = "aten.pro"; | |
22 | extraDomains = { | |
23 | "www.aten.pro" = null; | |
24 | }; | |
25 | }; | |
86f6924f IB |
26 | |
27 | services.phpfpm.poolConfigs.aten_prod = aten_prod.phpFpm.pool; | |
28 | system.activationScripts.aten_prod = aten_prod.activationScript; | |
42429ef0 | 29 | services.myWebsites.apacheConfig.aten_prod.modules = aten_prod.apache.modules; |
f8bde3d6 IB |
30 | services.myWebsites.production.modules = aten_prod.apache.modules; |
31 | services.myWebsites.production.vhostConfs.aten = { | |
32 | certName = "aten"; | |
33 | hosts = [ "aten.pro" "www.aten.pro" ]; | |
34 | root = aten_prod.webRoot; | |
35 | extraConfig = [ aten_prod.apache.vhostConf ]; | |
36 | }; | |
3013caf1 IB |
37 | }) |
38 | (lib.mkIf cfg.integration.enable { | |
39 | security.acme.certs."eldiron".extraDomains."dev.aten.pro" = null; | |
86f6924f IB |
40 | services.phpfpm.poolConfigs.aten_dev = aten_dev.phpFpm.pool; |
41 | system.activationScripts.aten_dev = aten_dev.activationScript; | |
f8bde3d6 IB |
42 | services.myWebsites.integration.modules = aten_dev.apache.modules; |
43 | services.myWebsites.integration.vhostConfs.aten = { | |
44 | certName = "eldiron"; | |
45 | hosts = [ "dev.aten.pro" ]; | |
46 | root = aten_dev.webRoot; | |
47 | extraConfig = [ aten_dev.apache.vhostConf ]; | |
48 | }; | |
3013caf1 IB |
49 | }) |
50 | ]; | |
51 | } | |
52 |