X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=nixops%2Fmodules%2Fwebsites%2Fchloe%2Fdefault.nix;fp=nixops%2Fmodules%2Fwebsites%2Fchloe%2Fdefault.nix;h=94cd4be5e7e0b99fadf03b93bbb0ccce5ac48cee;hb=01f21083a897b86bf148f1d2bb9c8edca4d3786a;hp=0000000000000000000000000000000000000000;hpb=bfe3c9c9df0c5112bc8806483292b55ed0f7e02d;p=perso%2FImmae%2FConfig%2FNix.git diff --git a/nixops/modules/websites/chloe/default.nix b/nixops/modules/websites/chloe/default.nix new file mode 100644 index 0000000..94cd4be --- /dev/null +++ b/nixops/modules/websites/chloe/default.nix @@ -0,0 +1,72 @@ +{ lib, pkgs, config, myconfig, mylibs, ... }: +let + chloe = pkgs.callPackage ./chloe.nix { inherit (mylibs) fetchedGitPrivate; }; + chloe_dev = chloe { + config = myconfig.env.websites.chloe.integration; + }; + chloe_prod = chloe { + config = myconfig.env.websites.chloe.production; + }; + + cfg = config.services.myWebsites.Chloe; +in { + options.services.myWebsites.Chloe = { + production = { + enable = lib.mkEnableOption "enable Chloe's website in production"; + }; + integration = { + enable = lib.mkEnableOption "enable Chloe'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 = "osteopathe-cc.fr"; + conf = ./goaccess.conf; + } + ]; + + security.acme.certs."chloe" = config.services.myCertificates.certConfig // { + domain = "osteopathe-cc.fr"; + extraDomains = { + "www.osteopathe-cc.fr" = null; + }; + }; + + services.myPhpfpm.poolConfigs.chloe_prod = chloe_prod.phpFpm.pool; + services.myPhpfpm.poolPhpConfigs.chloe_prod = '' + extension=${pkgs.php}/lib/php/extensions/mysqli.so + ''; + system.activationScripts.chloe_prod = chloe_prod.activationScript; + services.myWebsites.production.modules = chloe_prod.apache.modules; + services.myWebsites.production.vhostConfs.chloe = { + certName = "chloe"; + hosts = ["osteopathe-cc.fr" "www.osteopathe-cc.fr" ]; + root = chloe_prod.webRoot; + extraConfig = [ chloe_prod.apache.vhostConf ]; + }; + }) + (lib.mkIf cfg.integration.enable { + security.acme.certs."eldiron".extraDomains."chloe.immae.eu" = null; + services.myPhpfpm.poolConfigs.chloe_dev = chloe_dev.phpFpm.pool; + services.myPhpfpm.poolPhpConfigs.chloe_dev = '' + extension=${pkgs.php}/lib/php/extensions/mysqli.so + ''; + system.activationScripts.chloe_dev = chloe_dev.activationScript; + services.myWebsites.integration.modules = chloe_dev.apache.modules; + services.myWebsites.integration.vhostConfs.chloe = { + certName = "eldiron"; + hosts = ["chloe.immae.eu" ]; + root = chloe_dev.webRoot; + extraConfig = [ chloe_dev.apache.vhostConf ]; + }; + }) + ]; +}