]> git.immae.eu Git - perso/Immae/Config/Nix.git/blame - virtual/modules/websites/piedsjaloux/default.nix
Fix deprecation for networking addresses in hetzner
[perso/Immae/Config/Nix.git] / virtual / modules / websites / piedsjaloux / default.nix
CommitLineData
3013caf1
IB
1{ lib, pkgs, config, mylibs, ... }:
2let
091ae734 3 piedsjaloux = pkgs.callPackage ./piedsjaloux.nix { inherit (mylibs) checkEnv fetchedGitPrivate; };
86f6924f
IB
4 piedsjaloux_dev = piedsjaloux { environment = "dev"; };
5 piedsjaloux_prod = piedsjaloux { environment = "prod"; };
6
3013caf1
IB
7 cfg = config.services.myWebsites.PiedsJaloux;
8in {
9 options.services.myWebsites.PiedsJaloux = {
10 production = {
11 enable = lib.mkEnableOption "enable PiedsJaloux's website in production";
12 };
13 integration = {
14 enable = lib.mkEnableOption "enable PiedsJaloux's website in integration";
15 };
16 };
17
e4a945cd 18 imports = [
091ae734 19 ../commons/stats.nix
e4a945cd
IB
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 = "piedsjaloux.fr";
091ae734 28 conf = ./goaccess.conf;
e4a945cd
IB
29 }
30 ];
31
3013caf1
IB
32 security.acme.certs."piedsjaloux" = config.services.myCertificates.certConfig // {
33 domain = "piedsjaloux.fr";
34 extraDomains = {
35 "www.piedsjaloux.fr" = null;
36 };
37 };
86f6924f 38
98584540 39 services.myPhpfpm.poolConfigs.piedsjaloux_prod = piedsjaloux_prod.phpFpm.pool;
86f6924f 40 system.activationScripts.piedsjaloux_prod = piedsjaloux_prod.activationScript;
f8bde3d6
IB
41 services.myWebsites.production.modules = piedsjaloux_prod.apache.modules;
42 services.myWebsites.production.vhostConfs.piedsjaloux = {
43 certName = "piedsjaloux";
44 hosts = [ "piedsjaloux.fr" "www.piedsjaloux.fr" ];
45 root = piedsjaloux_prod.webRoot;
46 extraConfig = [ piedsjaloux_prod.apache.vhostConf ];
47 };
3013caf1
IB
48 })
49 (lib.mkIf cfg.integration.enable {
50 security.acme.certs."eldiron".extraDomains."piedsjaloux.immae.eu" = null;
98584540 51 services.myPhpfpm.poolConfigs.piedsjaloux_dev = piedsjaloux_dev.phpFpm.pool;
86f6924f 52 system.activationScripts.piedsjaloux_dev = piedsjaloux_dev.activationScript;
f8bde3d6
IB
53 services.myWebsites.integration.modules = piedsjaloux_dev.apache.modules;
54 services.myWebsites.integration.vhostConfs.piedsjaloux = {
55 certName = "eldiron";
56 hosts = [ "piedsjaloux.immae.eu" ];
57 root = piedsjaloux_dev.webRoot;
58 extraConfig = [ piedsjaloux_dev.apache.vhostConf ];
59 };
3013caf1
IB
60 })
61 ];
62}
63