{ lib, pkgs, config, myconfig, ... }: let adminer = pkgs.callPackage ../commons/adminer.nix {}; cfg = config.services.myWebsites.Florian; varDir = "/var/lib/ftp/florian"; env = myconfig.env.websites.florian; in { options.services.myWebsites.Florian = { production = { enable = lib.mkEnableOption "enable Florian's website production"; }; integration = { enable = lib.mkEnableOption "enable Florian's website integration"; }; }; config = lib.mkMerge [ (lib.mkIf cfg.production.enable { security.acme.certs."ftp".extraDomains."tellesflorian.com" = null; security.acme.certs."florian" = config.services.myCertificates.certConfig // { domain = "tellesflorian.com"; extraDomains = { "www.tellesflorian.com" = null; }; }; services.websites.production.modules = adminer.apache.modules; services.websites.production.vhostConfs.florian = { certName = "florian"; hosts = [ "tellesflorian.com" "www.tellesflorian.com" ]; root = "${varDir}/tellesflorian.com"; extraConfig = [ adminer.apache.vhostConf '' ServerAdmin ${env.server_admin} DirectoryIndex index.php index.htm index.html Options Indexes FollowSymLinks MultiViews Includes AllowOverride None Require all granted '' ]; }; }) (lib.mkIf cfg.integration.enable { security.acme.certs."ftp".extraDomains."florian.immae.eu" = null; security.acme.certs."eldiron".extraDomains."florian.immae.eu" = null; services.websites.integration.modules = adminer.apache.modules; services.websites.integration.vhostConfs.florian = { certName = "eldiron"; hosts = [ "florian.immae.eu" ]; root = "${varDir}/florian.immae.eu"; extraConfig = [ adminer.apache.vhostConf '' ServerAdmin ${env.server_admin} DirectoryIndex index.php index.htm index.html Options Indexes FollowSymLinks MultiViews Includes AllowOverride None Require all granted '' ]; }; }) ]; }