]>
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 { | |
1a718805 | 28 | secrets.keys = piedsjaloux_prod.keys; |
e4a945cd IB |
29 | services.myWebsites.commons.stats.enable = true; |
30 | services.myWebsites.commons.stats.sites = [ | |
b7ee93fc | 31 | { name = "piedsjaloux.fr"; } |
e4a945cd IB |
32 | ]; |
33 | ||
3013caf1 IB |
34 | security.acme.certs."piedsjaloux" = config.services.myCertificates.certConfig // { |
35 | domain = "piedsjaloux.fr"; | |
36 | extraDomains = { | |
37 | "www.piedsjaloux.fr" = null; | |
38 | }; | |
39 | }; | |
86f6924f | 40 | |
8eded9ec | 41 | services.myPhpfpm.preStart.piedsjaloux_prod = piedsjaloux_prod.phpFpm.preStart; |
a0c845b4 | 42 | services.myPhpfpm.serviceDependencies.piedsjaloux_prod = piedsjaloux_prod.phpFpm.serviceDeps; |
98584540 | 43 | services.myPhpfpm.poolConfigs.piedsjaloux_prod = piedsjaloux_prod.phpFpm.pool; |
86f6924f | 44 | system.activationScripts.piedsjaloux_prod = piedsjaloux_prod.activationScript; |
e5073add IB |
45 | system.extraSystemBuilderCmds = '' |
46 | mkdir -p $out/webapps | |
47 | ln -s ${piedsjaloux_prod.webRoot} $out/webapps/${piedsjaloux_prod.apache.webappName} | |
48 | ''; | |
f8bde3d6 IB |
49 | services.myWebsites.production.modules = piedsjaloux_prod.apache.modules; |
50 | services.myWebsites.production.vhostConfs.piedsjaloux = { | |
51 | certName = "piedsjaloux"; | |
52 | hosts = [ "piedsjaloux.fr" "www.piedsjaloux.fr" ]; | |
7da3ceec | 53 | root = piedsjaloux_prod.apache.root; |
f8bde3d6 IB |
54 | extraConfig = [ piedsjaloux_prod.apache.vhostConf ]; |
55 | }; | |
3013caf1 IB |
56 | }) |
57 | (lib.mkIf cfg.integration.enable { | |
1a718805 | 58 | secrets.keys = piedsjaloux_dev.keys; |
3013caf1 | 59 | security.acme.certs."eldiron".extraDomains."piedsjaloux.immae.eu" = null; |
8eded9ec | 60 | services.myPhpfpm.preStart.piedsjaloux_dev = piedsjaloux_dev.phpFpm.preStart; |
a0c845b4 | 61 | services.myPhpfpm.serviceDependencies.piedsjaloux_dev = piedsjaloux_dev.phpFpm.serviceDeps; |
98584540 | 62 | services.myPhpfpm.poolConfigs.piedsjaloux_dev = piedsjaloux_dev.phpFpm.pool; |
86f6924f | 63 | system.activationScripts.piedsjaloux_dev = piedsjaloux_dev.activationScript; |
e5073add IB |
64 | system.extraSystemBuilderCmds = '' |
65 | mkdir -p $out/webapps | |
66 | ln -s ${piedsjaloux_dev.webRoot} $out/webapps/${piedsjaloux_dev.apache.webappName} | |
67 | ''; | |
f8bde3d6 IB |
68 | services.myWebsites.integration.modules = piedsjaloux_dev.apache.modules; |
69 | services.myWebsites.integration.vhostConfs.piedsjaloux = { | |
70 | certName = "eldiron"; | |
71 | hosts = [ "piedsjaloux.immae.eu" ]; | |
e5073add | 72 | root = piedsjaloux_dev.apache.root; |
f8bde3d6 IB |
73 | extraConfig = [ piedsjaloux_dev.apache.vhostConf ]; |
74 | }; | |
3013caf1 IB |
75 | }) |
76 | ]; | |
77 | } | |
78 |