blob: db2ab491fa14c76492f92f01c7c1f0156b8ba3f1 (
plain) (
tree)
|
|
{ lib, pkgs, config, myconfig, mylibs, ... }:
let
aten = pkgs.callPackage ./aten.nix { inherit (mylibs) fetchedGitPrivate; };
aten_dev = aten {
config = myconfig.env.websites.aten.integration;
};
aten_prod = aten {
config = myconfig.env.websites.aten.production;
};
cfg = config.services.myWebsites.Aten;
in {
options.services.myWebsites.Aten = {
production = {
enable = lib.mkEnableOption "enable Aten's website in production";
};
integration = {
enable = lib.mkEnableOption "enable Aten's website in integration";
};
};
imports = [
../commons/stats.nix
];
config = lib.mkMerge [
(lib.mkIf cfg.production.enable {
services.myWebsites.commons.stats.enable = true;
services.myWebsites.commons.stats.sites = [
{
name = "aten.pro";
conf = ./goaccess.conf;
}
];
security.acme.certs."aten" = config.services.myCertificates.certConfig // {
domain = "aten.pro";
extraDomains = {
"www.aten.pro" = null;
};
};
services.myPhpfpm.poolConfigs.aten_prod = aten_prod.phpFpm.pool;
system.activationScripts.aten_prod = aten_prod.activationScript;
services.myWebsites.apacheConfig.aten_prod.modules = aten_prod.apache.modules;
services.myWebsites.production.modules = aten_prod.apache.modules;
services.myWebsites.production.vhostConfs.aten = {
certName = "aten";
hosts = [ "aten.pro" "www.aten.pro" ];
root = aten_prod.webRoot;
extraConfig = [ aten_prod.apache.vhostConf ];
};
})
(lib.mkIf cfg.integration.enable {
security.acme.certs."eldiron".extraDomains."dev.aten.pro" = null;
services.myPhpfpm.poolConfigs.aten_dev = aten_dev.phpFpm.pool;
system.activationScripts.aten_dev = aten_dev.activationScript;
services.myWebsites.integration.modules = aten_dev.apache.modules;
services.myWebsites.integration.vhostConfs.aten = {
certName = "eldiron";
hosts = [ "dev.aten.pro" ];
root = aten_dev.webRoot;
extraConfig = [ aten_dev.apache.vhostConf ];
};
})
];
}
|