blob: c5a904b3da3722094b04d662bba0a3e10fd11835 (
plain) (
tree)
|
|
{ lib, pkgs, config, myconfig, mylibs, ... }:
let
ludivinecassal = pkgs.callPackage ./ludivinecassal.nix { inherit (mylibs) fetchedGitPrivate; };
ludivinecassal_dev = ludivinecassal {
config = myconfig.env.websites.ludivinecassal.integration;
};
ludivinecassal_prod = ludivinecassal {
config = myconfig.env.websites.ludivinecassal.production;
};
cfg = config.services.myWebsites.Ludivine;
in {
options.services.myWebsites.Ludivine = {
production = {
enable = lib.mkEnableOption "enable Ludivine's website in production";
};
integration = {
enable = lib.mkEnableOption "enable Ludivine's website in integration";
};
};
config = lib.mkMerge [
(lib.mkIf cfg.production.enable {
deployment.keys = ludivinecassal_prod.keys;
services.myWebsites.commons.stats.enable = true;
services.myWebsites.commons.stats.sites = [
{
name = "ludivinecassal.com";
conf = ./goaccess.conf;
}
];
security.acme.certs."ludivinecassal" = config.services.myCertificates.certConfig // {
domain = "ludivinecassal.com";
extraDomains = {
"www.ludivinecassal.com" = null;
};
};
services.myPhpfpm.serviceDependencies.ludivinecassal_prod = ludivinecassal_prod.phpFpm.serviceDeps;
services.myPhpfpm.poolConfigs.ludivinecassal_prod = ludivinecassal_prod.phpFpm.pool;
system.activationScripts.ludivinecassal_prod = ludivinecassal_prod.activationScript;
system.extraSystemBuilderCmds = ''
mkdir -p $out/webapps
ln -s ${ludivinecassal_prod.webRoot} $out/webapps/${ludivinecassal_prod.apache.webappName}
'';
services.myWebsites.production.modules = ludivinecassal_prod.apache.modules;
services.myWebsites.production.vhostConfs.ludivine = {
certName = "ludivinecassal";
hosts = ["ludivinecassal.com" "www.ludivinecassal.com" ];
root = ludivinecassal_prod.apache.root;
extraConfig = [ ludivinecassal_prod.apache.vhostConf ];
};
})
(lib.mkIf cfg.integration.enable {
deployment.keys = ludivinecassal_dev.keys;
security.acme.certs."eldiron".extraDomains."ludivine.immae.eu" = null;
services.myPhpfpm.serviceDependencies.ludivinecassal_dev = ludivinecassal_dev.phpFpm.serviceDeps;
services.myPhpfpm.poolConfigs.ludivinecassal_dev = ludivinecassal_dev.phpFpm.pool;
system.activationScripts.ludivinecassal_dev = ludivinecassal_dev.activationScript;
system.extraSystemBuilderCmds = ''
mkdir -p $out/webapps
ln -s ${ludivinecassal_dev.webRoot} $out/webapps/${ludivinecassal_dev.apache.webappName}
'';
services.myWebsites.apacheConfig.ludivinecassal_dev.modules = ludivinecassal_dev.apache.modules;
services.myWebsites.integration.modules = ludivinecassal_dev.apache.modules;
services.myWebsites.integration.vhostConfs.ludivine = {
certName = "eldiron";
hosts = [ "ludivine.immae.eu" ];
root = ludivinecassal_dev.apache.root;
extraConfig = [ ludivinecassal_dev.apache.vhostConf ];
};
})
];
}
|