]>
Commit | Line | Data |
---|---|---|
9d90e7e2 | 1 | { lib, pkgs, config, myconfig, mylibs, ... }: |
3013caf1 | 2 | let |
9d90e7e2 IB |
3 | piedsjaloux = pkgs.callPackage ./piedsjaloux.nix { inherit (mylibs) fetchedGitPrivate; }; |
4 | piedsjaloux_dev = piedsjaloux { | |
5 | config = myconfig.env.websites.piedsjaloux.integration; | |
6 | }; | |
7 | piedsjaloux_prod = piedsjaloux { | |
8 | config = myconfig.env.websites.piedsjaloux.production; | |
9 | }; | |
86f6924f | 10 | |
3013caf1 IB |
11 | cfg = config.services.myWebsites.PiedsJaloux; |
12 | in { | |
13 | options.services.myWebsites.PiedsJaloux = { | |
14 | production = { | |
15 | enable = lib.mkEnableOption "enable PiedsJaloux's website in production"; | |
16 | }; | |
17 | integration = { | |
18 | enable = lib.mkEnableOption "enable PiedsJaloux's website in integration"; | |
19 | }; | |
20 | }; | |
21 | ||
e4a945cd | 22 | imports = [ |
091ae734 | 23 | ../commons/stats.nix |
e4a945cd IB |
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 = "piedsjaloux.fr"; | |
091ae734 | 32 | conf = ./goaccess.conf; |
e4a945cd IB |
33 | } |
34 | ]; | |
35 | ||
3013caf1 IB |
36 | security.acme.certs."piedsjaloux" = config.services.myCertificates.certConfig // { |
37 | domain = "piedsjaloux.fr"; | |
38 | extraDomains = { | |
39 | "www.piedsjaloux.fr" = null; | |
40 | }; | |
41 | }; | |
86f6924f | 42 | |
98584540 | 43 | services.myPhpfpm.poolConfigs.piedsjaloux_prod = piedsjaloux_prod.phpFpm.pool; |
86f6924f | 44 | system.activationScripts.piedsjaloux_prod = piedsjaloux_prod.activationScript; |
f8bde3d6 IB |
45 | services.myWebsites.production.modules = piedsjaloux_prod.apache.modules; |
46 | services.myWebsites.production.vhostConfs.piedsjaloux = { | |
47 | certName = "piedsjaloux"; | |
48 | hosts = [ "piedsjaloux.fr" "www.piedsjaloux.fr" ]; | |
49 | root = piedsjaloux_prod.webRoot; | |
50 | extraConfig = [ piedsjaloux_prod.apache.vhostConf ]; | |
51 | }; | |
3013caf1 IB |
52 | }) |
53 | (lib.mkIf cfg.integration.enable { | |
54 | security.acme.certs."eldiron".extraDomains."piedsjaloux.immae.eu" = null; | |
98584540 | 55 | services.myPhpfpm.poolConfigs.piedsjaloux_dev = piedsjaloux_dev.phpFpm.pool; |
86f6924f | 56 | system.activationScripts.piedsjaloux_dev = piedsjaloux_dev.activationScript; |
f8bde3d6 IB |
57 | services.myWebsites.integration.modules = piedsjaloux_dev.apache.modules; |
58 | services.myWebsites.integration.vhostConfs.piedsjaloux = { | |
59 | certName = "eldiron"; | |
60 | hosts = [ "piedsjaloux.immae.eu" ]; | |
61 | root = piedsjaloux_dev.webRoot; | |
62 | extraConfig = [ piedsjaloux_dev.apache.vhostConf ]; | |
63 | }; | |
3013caf1 IB |
64 | }) |
65 | ]; | |
66 | } | |
67 |