]>
Commit | Line | Data |
---|---|---|
9d90e7e2 | 1 | { lib, pkgs, config, mylibs, myconfig, ... }: |
3013caf1 | 2 | let |
9d90e7e2 IB |
3 | connexionswing = pkgs.callPackage ./connexionswing.nix { inherit (mylibs) fetchedGitPrivate; }; |
4 | connexionswing_dev = connexionswing { | |
5 | config = myconfig.env.websites.connexionswing.integration; | |
6 | }; | |
7 | connexionswing_prod = connexionswing { | |
8 | config = myconfig.env.websites.connexionswing.production; | |
9 | }; | |
86f6924f | 10 | |
3013caf1 IB |
11 | cfg = config.services.myWebsites.Connexionswing; |
12 | in { | |
13 | options.services.myWebsites.Connexionswing = { | |
14 | production = { | |
15 | enable = lib.mkEnableOption "enable Connexionswing's website in production"; | |
16 | }; | |
17 | integration = { | |
18 | enable = lib.mkEnableOption "enable Connexionswing'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 { | |
1a718805 | 28 | secrets.keys = connexionswing_prod.keys; |
e4a945cd IB |
29 | services.myWebsites.commons.stats.enable = true; |
30 | services.myWebsites.commons.stats.sites = [ | |
b7ee93fc | 31 | { name = "connexionswing.com"; } |
e4a945cd IB |
32 | ]; |
33 | ||
3013caf1 IB |
34 | security.acme.certs."connexionswing" = config.services.myCertificates.certConfig // { |
35 | domain = "connexionswing.com"; | |
36 | extraDomains = { | |
37 | "www.connexionswing.com" = null; | |
38 | "sandetludo.com" = null; | |
39 | "www.sandetludo.com" = null; | |
40 | }; | |
41 | }; | |
86f6924f | 42 | |
8eded9ec | 43 | services.myPhpfpm.preStart.connexionswing_prod = connexionswing_prod.phpFpm.preStart; |
a0c845b4 | 44 | services.myPhpfpm.serviceDependencies.connexionswing_prod = connexionswing_prod.phpFpm.serviceDeps; |
98584540 | 45 | services.myPhpfpm.poolConfigs.connexionswing_prod = connexionswing_prod.phpFpm.pool; |
2abb172b | 46 | services.myPhpfpm.poolPhpConfigs.connexionswing_prod = connexionswing_prod.phpFpm.phpConfig; |
86f6924f | 47 | system.activationScripts.connexionswing_prod = connexionswing_prod.activationScript; |
e5073add IB |
48 | system.extraSystemBuilderCmds = '' |
49 | mkdir -p $out/webapps | |
50 | ln -s ${connexionswing_prod.webRoot} $out/webapps/${connexionswing_prod.apache.webappName} | |
51 | ''; | |
f8bde3d6 IB |
52 | services.myWebsites.production.modules = connexionswing_prod.apache.modules; |
53 | services.myWebsites.production.vhostConfs.connexionswing = { | |
54 | certName = "connexionswing"; | |
55 | hosts = ["connexionswing.com" "sandetludo.com" "www.connexionswing.com" "www.sandetludo.com" ]; | |
7da3ceec | 56 | root = connexionswing_prod.apache.root; |
f8bde3d6 IB |
57 | extraConfig = [ connexionswing_prod.apache.vhostConf ]; |
58 | }; | |
3013caf1 IB |
59 | }) |
60 | (lib.mkIf cfg.integration.enable { | |
1a718805 | 61 | secrets.keys = connexionswing_dev.keys; |
3013caf1 IB |
62 | security.acme.certs."eldiron".extraDomains."sandetludo.immae.eu" = null; |
63 | security.acme.certs."eldiron".extraDomains."connexionswing.immae.eu" = null; | |
8eded9ec | 64 | services.myPhpfpm.preStart.connexionswing_dev = connexionswing_dev.phpFpm.preStart; |
a0c845b4 | 65 | services.myPhpfpm.serviceDependencies.connexionswing_dev = connexionswing_dev.phpFpm.serviceDeps; |
98584540 | 66 | services.myPhpfpm.poolConfigs.connexionswing_dev = connexionswing_dev.phpFpm.pool; |
2abb172b | 67 | services.myPhpfpm.poolPhpConfigs.connexionswing_dev = connexionswing_dev.phpFpm.phpConfig; |
86f6924f | 68 | system.activationScripts.connexionswing_dev = connexionswing_dev.activationScript; |
e5073add IB |
69 | system.extraSystemBuilderCmds = '' |
70 | mkdir -p $out/webapps | |
71 | ln -s ${connexionswing_dev.webRoot} $out/webapps/${connexionswing_dev.apache.webappName} | |
72 | ''; | |
f8bde3d6 IB |
73 | services.myWebsites.integration.modules = connexionswing_dev.apache.modules; |
74 | services.myWebsites.integration.vhostConfs.connexionswing = { | |
75 | certName = "eldiron"; | |
76 | hosts = ["connexionswing.immae.eu" "sandetludo.immae.eu" ]; | |
e5073add | 77 | root = connexionswing_dev.apache.root; |
f8bde3d6 IB |
78 | extraConfig = [ connexionswing_dev.apache.vhostConf ]; |
79 | }; | |
3013caf1 IB |
80 | }) |
81 | ]; | |
82 | } | |
83 |