1 { lib, pkgs, config, mylibs, myconfig, ... }:
3 connexionswing = pkgs.callPackage ./connexionswing.nix { inherit (mylibs) fetchedGitPrivate; };
4 connexionswing_dev = connexionswing {
5 config = myconfig.env.websites.connexionswing.integration;
7 connexionswing_prod = connexionswing {
8 config = myconfig.env.websites.connexionswing.production;
11 cfg = config.services.myWebsites.Connexionswing;
13 options.services.myWebsites.Connexionswing = {
15 enable = lib.mkEnableOption "enable Connexionswing's website in production";
18 enable = lib.mkEnableOption "enable Connexionswing's website in integration";
26 config = lib.mkMerge [
27 (lib.mkIf cfg.production.enable {
28 mySecrets.keys = connexionswing_prod.keys;
29 services.myWebsites.commons.stats.enable = true;
30 services.myWebsites.commons.stats.sites = [
32 name = "connexionswing.com";
33 conf = ./goaccess.conf;
37 security.acme.certs."connexionswing" = config.services.myCertificates.certConfig // {
38 domain = "connexionswing.com";
40 "www.connexionswing.com" = null;
41 "sandetludo.com" = null;
42 "www.sandetludo.com" = null;
46 services.myPhpfpm.preStart.connexionswing_prod = connexionswing_prod.phpFpm.preStart;
47 services.myPhpfpm.serviceDependencies.connexionswing_prod = connexionswing_prod.phpFpm.serviceDeps;
48 services.myPhpfpm.poolConfigs.connexionswing_prod = connexionswing_prod.phpFpm.pool;
49 services.myPhpfpm.poolPhpConfigs.connexionswing_prod = connexionswing_prod.phpFpm.phpConfig;
50 system.activationScripts.connexionswing_prod = connexionswing_prod.activationScript;
51 system.extraSystemBuilderCmds = ''
53 ln -s ${connexionswing_prod.webRoot} $out/webapps/${connexionswing_prod.apache.webappName}
55 services.myWebsites.production.modules = connexionswing_prod.apache.modules;
56 services.myWebsites.production.vhostConfs.connexionswing = {
57 certName = "connexionswing";
58 hosts = ["connexionswing.com" "sandetludo.com" "www.connexionswing.com" "www.sandetludo.com" ];
59 root = connexionswing_prod.apache.root;
60 extraConfig = [ connexionswing_prod.apache.vhostConf ];
63 (lib.mkIf cfg.integration.enable {
64 mySecrets.keys = connexionswing_dev.keys;
65 security.acme.certs."eldiron".extraDomains."sandetludo.immae.eu" = null;
66 security.acme.certs."eldiron".extraDomains."connexionswing.immae.eu" = null;
67 services.myPhpfpm.preStart.connexionswing_dev = connexionswing_dev.phpFpm.preStart;
68 services.myPhpfpm.serviceDependencies.connexionswing_dev = connexionswing_dev.phpFpm.serviceDeps;
69 services.myPhpfpm.poolConfigs.connexionswing_dev = connexionswing_dev.phpFpm.pool;
70 services.myPhpfpm.poolPhpConfigs.connexionswing_dev = connexionswing_dev.phpFpm.phpConfig;
71 system.activationScripts.connexionswing_dev = connexionswing_dev.activationScript;
72 system.extraSystemBuilderCmds = ''
74 ln -s ${connexionswing_dev.webRoot} $out/webapps/${connexionswing_dev.apache.webappName}
76 services.myWebsites.integration.modules = connexionswing_dev.apache.modules;
77 services.myWebsites.integration.vhostConfs.connexionswing = {
79 hosts = ["connexionswing.immae.eu" "sandetludo.immae.eu" ];
80 root = connexionswing_dev.apache.root;
81 extraConfig = [ connexionswing_dev.apache.vhostConf ];