1 { lib, pkgs, config, ... }:
3 secrets = config.myEnv.websites.connexionswing.production;
4 app = pkgs.callPackage ./app {
5 composerEnv = pkgs.composerEnv.override { php = pkgs.php72; };
6 environment = secrets.environment;
7 varDir = "/var/lib/connexionswing_production";
8 secretsPath = config.secrets.fullPaths."websites/connexionswing/production";
10 cfg = config.myServices.websites.connexionswing.production;
11 pcfg = config.services.phpApplication;
13 options.myServices.websites.connexionswing.production.enable = lib.mkEnableOption "enable Connexionswing's website in production";
15 config = lib.mkIf cfg.enable {
16 services.duplyBackup.profiles.connexionswing_production.rootDir = app.varDir;
17 services.duplyBackup.profiles.connexionswing_production.remotes = ["eriomem" "ovh"];
18 services.webstats.sites = [ { name = "connexionswing.com"; } ];
19 services.phpApplication.apps.connexionswing_production = {
20 websiteEnv = "production";
21 httpdUser = config.services.httpd.Prod.user;
22 httpdGroup = config.services.httpd.Prod.group;
23 inherit (app) webRoot varDir;
30 serviceDeps = [ "mysql.service" ];
32 "./bin/console --env=${app.environment} cache:clear --no-warmup"
34 phpOpenbasedir = [ "/tmp" "/run/wrappers/bin/sendmail" ];
36 "php_admin_value[upload_max_filesize]" = "20M";
37 "php_admin_value[post_max_size]" = "20M";
38 #"php_admin_flag[log_errors]" = "on";
40 "pm.max_children" = "20";
41 "pm.start_servers" = "2";
42 "pm.min_spare_servers" = "1";
43 "pm.max_spare_servers" = "3";
46 config.secrets.fullPaths."websites/connexionswing/production"
48 phpPackage = pkgs.php72;
53 dest = "websites/connexionswing/production";
54 user = config.services.httpd.Prod.user;
55 group = config.services.httpd.Prod.group;
58 # This file is auto-generated during the composer install
60 database_host: ${secrets.mysql.host}
61 database_port: ${secrets.mysql.port}
62 database_name: ${secrets.mysql.database}
63 database_user: ${secrets.mysql.user}
64 database_password: ${secrets.mysql.password}
65 database_server_version: ${pkgs.mariadb.mysqlVersion}
66 mailer_transport: sendmail
70 subscription_email: ${secrets.email}
72 secret: ${secrets.secret}
74 swiftmailer.mailer.default.transport:
75 class: Swift_SendmailTransport
76 arguments: ['/run/wrappers/bin/sendmail -bs']
81 services.websites.env.production.vhostConfs.connexionswing_production = {
82 certName = "connexionswing";
83 certMainHost = "connexionswing.com";
84 hosts = ["connexionswing.com" "sandetludo.com" "www.connexionswing.com" "www.sandetludo.com" ];
85 root = pcfg.webappDirs.connexionswing_production;
89 SetHandler "proxy:unix:${pcfg.phpListenPaths.connexionswing_production}|fcgi://localhost"
92 <Directory ${app.varDir}/medias>
93 Options FollowSymLinks
98 <Directory ${app.varDir}/uploads>
99 Options FollowSymLinks
104 Use Stats connexionswing.com
106 <Directory ${pcfg.webappDirs.connexionswing_production}>
107 Options Indexes FollowSymLinks MultiViews Includes