diff options
Diffstat (limited to 'nixops/modules/websites/aten/default.nix')
-rw-r--r-- | nixops/modules/websites/aten/default.nix | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/nixops/modules/websites/aten/default.nix b/nixops/modules/websites/aten/default.nix new file mode 100644 index 0000000..db2ab49 --- /dev/null +++ b/nixops/modules/websites/aten/default.nix | |||
@@ -0,0 +1,68 @@ | |||
1 | { lib, pkgs, config, myconfig, mylibs, ... }: | ||
2 | let | ||
3 | aten = pkgs.callPackage ./aten.nix { inherit (mylibs) fetchedGitPrivate; }; | ||
4 | aten_dev = aten { | ||
5 | config = myconfig.env.websites.aten.integration; | ||
6 | }; | ||
7 | aten_prod = aten { | ||
8 | config = myconfig.env.websites.aten.production; | ||
9 | }; | ||
10 | |||
11 | cfg = config.services.myWebsites.Aten; | ||
12 | in { | ||
13 | options.services.myWebsites.Aten = { | ||
14 | production = { | ||
15 | enable = lib.mkEnableOption "enable Aten's website in production"; | ||
16 | }; | ||
17 | integration = { | ||
18 | enable = lib.mkEnableOption "enable Aten's website in integration"; | ||
19 | }; | ||
20 | }; | ||
21 | |||
22 | imports = [ | ||
23 | ../commons/stats.nix | ||
24 | ]; | ||
25 | |||
26 | config = lib.mkMerge [ | ||
27 | (lib.mkIf cfg.production.enable { | ||
28 | services.myWebsites.commons.stats.enable = true; | ||
29 | services.myWebsites.commons.stats.sites = [ | ||
30 | { | ||
31 | name = "aten.pro"; | ||
32 | conf = ./goaccess.conf; | ||
33 | } | ||
34 | ]; | ||
35 | |||
36 | security.acme.certs."aten" = config.services.myCertificates.certConfig // { | ||
37 | domain = "aten.pro"; | ||
38 | extraDomains = { | ||
39 | "www.aten.pro" = null; | ||
40 | }; | ||
41 | }; | ||
42 | |||
43 | services.myPhpfpm.poolConfigs.aten_prod = aten_prod.phpFpm.pool; | ||
44 | system.activationScripts.aten_prod = aten_prod.activationScript; | ||
45 | services.myWebsites.apacheConfig.aten_prod.modules = aten_prod.apache.modules; | ||
46 | services.myWebsites.production.modules = aten_prod.apache.modules; | ||
47 | services.myWebsites.production.vhostConfs.aten = { | ||
48 | certName = "aten"; | ||
49 | hosts = [ "aten.pro" "www.aten.pro" ]; | ||
50 | root = aten_prod.webRoot; | ||
51 | extraConfig = [ aten_prod.apache.vhostConf ]; | ||
52 | }; | ||
53 | }) | ||
54 | (lib.mkIf cfg.integration.enable { | ||
55 | security.acme.certs."eldiron".extraDomains."dev.aten.pro" = null; | ||
56 | services.myPhpfpm.poolConfigs.aten_dev = aten_dev.phpFpm.pool; | ||
57 | system.activationScripts.aten_dev = aten_dev.activationScript; | ||
58 | services.myWebsites.integration.modules = aten_dev.apache.modules; | ||
59 | services.myWebsites.integration.vhostConfs.aten = { | ||
60 | certName = "eldiron"; | ||
61 | hosts = [ "dev.aten.pro" ]; | ||
62 | root = aten_dev.webRoot; | ||
63 | extraConfig = [ aten_dev.apache.vhostConf ]; | ||
64 | }; | ||
65 | }) | ||
66 | ]; | ||
67 | } | ||
68 | |||