{ lib, pkgs, config, myconfig, ... }: let aten = pkgs.callPackage ./builder.nix { inherit (pkgs.webapps) aten; config = myconfig.env.websites.aten.integration; apacheUser = config.services.httpd.Inte.user; apacheGroup = config.services.httpd.Inte.group; }; cfg = config.myServices.websites.aten.integration; in { options.myServices.websites.aten.integration.enable = lib.mkEnableOption "enable Aten's website in integration"; config = lib.mkIf cfg.enable { services.phpApplication.aten_dev = let app = pkgs.webapps.aten.override { environment = "dev"; }; in { websiteEnv = "integration"; httpdUser = config.services.httpd.Inte.user; httpdGroup = config.services.httpd.Inte.group; inherit (app) webRoot varDir; inherit app; serviceDeps = [ "postgresql.service" ]; preStartActions = [ "APP_ENV=${app.environment} ./bin/console --env=${app.environment} cache:clear --no-warmup" ]; watchFiles = [ "${config.secrets.location}/webapps/${app.environment}-aten" ]; webappName = "aten_dev"; }; secrets.keys = aten.keys; services.phpfpm.poolConfigs.aten_dev = aten.phpFpm.pool; services.websites.integration.vhostConfs.aten = { certName = "eldiron"; addToCerts = true; hosts = [ "dev.aten.pro" ]; root = aten.apache.root; extraConfig = [ aten.apache.vhostConf ]; }; }; }