]>
Commit | Line | Data |
---|---|---|
8a964143 | 1 | { lib, pkgs, config, myconfig, ... }: |
3013caf1 | 2 | let |
52e8779d | 3 | connexionswing_dev = pkgs.callPackage ./connexionswing.nix { |
8f904d0d | 4 | inherit (pkgs.webapps) connexionswing; |
52e8779d IB |
5 | config = myconfig.env.websites.connexionswing.integration; |
6 | }; | |
7 | connexionswing_prod = pkgs.callPackage ./connexionswing.nix { | |
8f904d0d | 8 | inherit (pkgs.webapps) connexionswing; |
52e8779d IB |
9 | config = myconfig.env.websites.connexionswing.production; |
10 | }; | |
86f6924f | 11 | |
52e8779d | 12 | cfg = config.services.myWebsites.Connexionswing; |
3013caf1 IB |
13 | in { |
14 | options.services.myWebsites.Connexionswing = { | |
15 | production = { | |
16 | enable = lib.mkEnableOption "enable Connexionswing's website in production"; | |
17 | }; | |
18 | integration = { | |
19 | enable = lib.mkEnableOption "enable Connexionswing's website in integration"; | |
20 | }; | |
21 | }; | |
22 | ||
23 | config = lib.mkMerge [ | |
24 | (lib.mkIf cfg.production.enable { | |
1a718805 | 25 | secrets.keys = connexionswing_prod.keys; |
9eae2b47 | 26 | services.webstats.sites = [ { name = "connexionswing.com"; } ]; |
e4a945cd | 27 | |
8eded9ec | 28 | services.myPhpfpm.preStart.connexionswing_prod = connexionswing_prod.phpFpm.preStart; |
a0c845b4 | 29 | services.myPhpfpm.serviceDependencies.connexionswing_prod = connexionswing_prod.phpFpm.serviceDeps; |
98584540 | 30 | services.myPhpfpm.poolConfigs.connexionswing_prod = connexionswing_prod.phpFpm.pool; |
2abb172b | 31 | services.myPhpfpm.poolPhpConfigs.connexionswing_prod = connexionswing_prod.phpFpm.phpConfig; |
86f6924f | 32 | system.activationScripts.connexionswing_prod = connexionswing_prod.activationScript; |
e5073add IB |
33 | system.extraSystemBuilderCmds = '' |
34 | mkdir -p $out/webapps | |
52e8779d | 35 | ln -s ${connexionswing_prod.app.webRoot} $out/webapps/${connexionswing_prod.apache.webappName} |
e5073add | 36 | ''; |
daf64e3f IB |
37 | services.websites.production.modules = connexionswing_prod.apache.modules; |
38 | services.websites.production.vhostConfs.connexionswing = { | |
7df420c2 IB |
39 | certName = "connexionswing"; |
40 | certMainHost = "connexionswing.com"; | |
41 | hosts = ["connexionswing.com" "sandetludo.com" "www.connexionswing.com" "www.sandetludo.com" ]; | |
42 | root = connexionswing_prod.apache.root; | |
43 | extraConfig = [ connexionswing_prod.apache.vhostConf ]; | |
f8bde3d6 | 44 | }; |
3013caf1 IB |
45 | }) |
46 | (lib.mkIf cfg.integration.enable { | |
1a718805 | 47 | secrets.keys = connexionswing_dev.keys; |
8eded9ec | 48 | services.myPhpfpm.preStart.connexionswing_dev = connexionswing_dev.phpFpm.preStart; |
a0c845b4 | 49 | services.myPhpfpm.serviceDependencies.connexionswing_dev = connexionswing_dev.phpFpm.serviceDeps; |
98584540 | 50 | services.myPhpfpm.poolConfigs.connexionswing_dev = connexionswing_dev.phpFpm.pool; |
2abb172b | 51 | services.myPhpfpm.poolPhpConfigs.connexionswing_dev = connexionswing_dev.phpFpm.phpConfig; |
86f6924f | 52 | system.activationScripts.connexionswing_dev = connexionswing_dev.activationScript; |
e5073add IB |
53 | system.extraSystemBuilderCmds = '' |
54 | mkdir -p $out/webapps | |
52e8779d | 55 | ln -s ${connexionswing_dev.app.webRoot} $out/webapps/${connexionswing_dev.apache.webappName} |
e5073add | 56 | ''; |
daf64e3f IB |
57 | services.websites.integration.modules = connexionswing_dev.apache.modules; |
58 | services.websites.integration.vhostConfs.connexionswing = { | |
f8bde3d6 | 59 | certName = "eldiron"; |
7df420c2 | 60 | addToCerts = true; |
f8bde3d6 | 61 | hosts = ["connexionswing.immae.eu" "sandetludo.immae.eu" ]; |
e5073add | 62 | root = connexionswing_dev.apache.root; |
f8bde3d6 IB |
63 | extraConfig = [ connexionswing_dev.apache.vhostConf ]; |
64 | }; | |
3013caf1 IB |
65 | }) |
66 | ]; | |
67 | } | |
68 |