]> git.immae.eu Git - perso/Immae/Config/Nix.git/blame - modules/private/websites/aten/integration.nix
Start moving php configuration to a dedicated module
[perso/Immae/Config/Nix.git] / modules / private / websites / aten / integration.nix
CommitLineData
f8026b6e
IB
1{ lib, pkgs, config, myconfig, ... }:
2let
3 aten = pkgs.callPackage ./builder.nix {
4 inherit (pkgs.webapps) aten;
5 config = myconfig.env.websites.aten.integration;
6 apacheUser = config.services.httpd.Inte.user;
7 apacheGroup = config.services.httpd.Inte.group;
8 };
9
10 cfg = config.myServices.websites.aten.integration;
11in {
12 options.myServices.websites.aten.integration.enable = lib.mkEnableOption "enable Aten's website in integration";
13
14 config = lib.mkIf cfg.enable {
2e48907d
IB
15 services.phpApplication.aten_dev = let
16 app = pkgs.webapps.aten.override { environment = "dev"; };
17 in {
18 websiteEnv = "integration";
19 httpdUser = config.services.httpd.Inte.user;
20 httpdGroup = config.services.httpd.Inte.group;
21 inherit (app) webRoot varDir;
22 inherit app;
23 serviceDeps = [ "postgresql.service" ];
24 preStartActions = [
25 "APP_ENV=${app.environment} ./bin/console --env=${app.environment} cache:clear --no-warmup"
26 ];
27 watchFiles = [
28 "${config.secrets.location}/webapps/${app.environment}-aten"
29 ];
30 webappName = "aten_dev";
31 };
32
f8026b6e 33 secrets.keys = aten.keys;
f40f5b23 34 services.phpfpm.poolConfigs.aten_dev = aten.phpFpm.pool;
f8026b6e
IB
35 services.websites.integration.vhostConfs.aten = {
36 certName = "eldiron";
37 addToCerts = true;
38 hosts = [ "dev.aten.pro" ];
39 root = aten.apache.root;
40 extraConfig = [ aten.apache.vhostConf ];
41 };
42 };
43}