]> git.immae.eu Git - perso/Immae/Config/Nix.git/blame - nixops/modules/websites/aten/default.nix
Use password store to store environment
[perso/Immae/Config/Nix.git] / nixops / modules / websites / aten / default.nix
CommitLineData
9d90e7e2 1{ lib, pkgs, config, myconfig, mylibs, ... }:
3013caf1 2let
9d90e7e2
IB
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 };
86f6924f 10
3013caf1
IB
11 cfg = config.services.myWebsites.Aten;
12in {
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
091ae734
IB
22 imports = [
23 ../commons/stats.nix
24 ];
25
3013caf1
IB
26 config = lib.mkMerge [
27 (lib.mkIf cfg.production.enable {
e4a945cd
IB
28 services.myWebsites.commons.stats.enable = true;
29 services.myWebsites.commons.stats.sites = [
30 {
31 name = "aten.pro";
091ae734 32 conf = ./goaccess.conf;
e4a945cd
IB
33 }
34 ];
35
3013caf1
IB
36 security.acme.certs."aten" = config.services.myCertificates.certConfig // {
37 domain = "aten.pro";
38 extraDomains = {
39 "www.aten.pro" = null;
40 };
41 };
86f6924f 42
98584540 43 services.myPhpfpm.poolConfigs.aten_prod = aten_prod.phpFpm.pool;
86f6924f 44 system.activationScripts.aten_prod = aten_prod.activationScript;
42429ef0 45 services.myWebsites.apacheConfig.aten_prod.modules = aten_prod.apache.modules;
f8bde3d6
IB
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 };
3013caf1
IB
53 })
54 (lib.mkIf cfg.integration.enable {
55 security.acme.certs."eldiron".extraDomains."dev.aten.pro" = null;
98584540 56 services.myPhpfpm.poolConfigs.aten_dev = aten_dev.phpFpm.pool;
86f6924f 57 system.activationScripts.aten_dev = aten_dev.activationScript;
f8bde3d6
IB
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 };
3013caf1
IB
65 })
66 ];
67}
68