]> git.immae.eu Git - perso/Immae/Config/Nix.git/blame - virtual/modules/websites/aten/default.nix
Fix deprecation for networking addresses in hetzner
[perso/Immae/Config/Nix.git] / virtual / modules / websites / aten / default.nix
CommitLineData
3013caf1
IB
1{ lib, pkgs, config, mylibs, ... }:
2let
091ae734 3 aten = pkgs.callPackage ./aten.nix { inherit (mylibs) checkEnv fetchedGitPrivate; };
86f6924f
IB
4 aten_dev = aten { environment = "dev"; };
5 aten_prod = aten { environment = "prod"; };
6
3013caf1
IB
7 cfg = config.services.myWebsites.Aten;
8in {
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
091ae734
IB
18 imports = [
19 ../commons/stats.nix
20 ];
21
3013caf1
IB
22 config = lib.mkMerge [
23 (lib.mkIf cfg.production.enable {
e4a945cd
IB
24 services.myWebsites.commons.stats.enable = true;
25 services.myWebsites.commons.stats.sites = [
26 {
27 name = "aten.pro";
091ae734 28 conf = ./goaccess.conf;
e4a945cd
IB
29 }
30 ];
31
3013caf1
IB
32 security.acme.certs."aten" = config.services.myCertificates.certConfig // {
33 domain = "aten.pro";
34 extraDomains = {
35 "www.aten.pro" = null;
36 };
37 };
86f6924f 38
98584540 39 services.myPhpfpm.poolConfigs.aten_prod = aten_prod.phpFpm.pool;
86f6924f 40 system.activationScripts.aten_prod = aten_prod.activationScript;
42429ef0 41 services.myWebsites.apacheConfig.aten_prod.modules = aten_prod.apache.modules;
f8bde3d6
IB
42 services.myWebsites.production.modules = aten_prod.apache.modules;
43 services.myWebsites.production.vhostConfs.aten = {
44 certName = "aten";
45 hosts = [ "aten.pro" "www.aten.pro" ];
46 root = aten_prod.webRoot;
47 extraConfig = [ aten_prod.apache.vhostConf ];
48 };
3013caf1
IB
49 })
50 (lib.mkIf cfg.integration.enable {
51 security.acme.certs."eldiron".extraDomains."dev.aten.pro" = null;
98584540 52 services.myPhpfpm.poolConfigs.aten_dev = aten_dev.phpFpm.pool;
86f6924f 53 system.activationScripts.aten_dev = aten_dev.activationScript;
f8bde3d6
IB
54 services.myWebsites.integration.modules = aten_dev.apache.modules;
55 services.myWebsites.integration.vhostConfs.aten = {
56 certName = "eldiron";
57 hosts = [ "dev.aten.pro" ];
58 root = aten_dev.webRoot;
59 extraConfig = [ aten_dev.apache.vhostConf ];
60 };
3013caf1
IB
61 })
62 ];
63}
64