aboutsummaryrefslogtreecommitdiff
path: root/modules/private/websites/piedsjaloux/integration.nix
blob: 8007c918f739614a543a8f84962ae5b8eaeee21e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
{ lib, pkgs, config, myconfig,  ... }:
let
  piedsjaloux  = pkgs.callPackage ./builder.nix {
    inherit (pkgs.webapps) piedsjaloux;
    config = myconfig.env.websites.piedsjaloux.integration;
    apacheUser = config.services.httpd.Inte.user;
    apacheGroup = config.services.httpd.Inte.group;
  };

  cfg = config.myServices.websites.piedsjaloux.integration;
in {
  options.myServices.websites.piedsjaloux.integration.enable = lib.mkEnableOption "enable PiedsJaloux's website in integration";

  config = lib.mkIf cfg.enable {
    secrets.keys = piedsjaloux.keys;
    systemd.services.phpfpm-piedsjaloux_dev.after = lib.mkAfter piedsjaloux.phpFpm.serviceDeps;
    systemd.services.phpfpm-piedsjaloux_dev.wants = piedsjaloux.phpFpm.serviceDeps;
    systemd.services.phpfpm-piedsjaloux_dev.preStart = lib.mkAfter piedsjaloux.phpFpm.preStart;
    services.phpfpm.poolConfigs.piedsjaloux_dev = piedsjaloux.phpFpm.pool;
    system.activationScripts.piedsjaloux_dev = piedsjaloux.activationScript;
    myServices.websites.webappDirs."${piedsjaloux.apache.webappName}" = piedsjaloux.app.webRoot;
    services.websites.env.integration.modules = piedsjaloux.apache.modules;
    services.websites.env.integration.vhostConfs.piedsjaloux = {
      certName    = "eldiron";
      addToCerts  = true;
      hosts       = [ "piedsjaloux.immae.eu" ];
      root        = piedsjaloux.apache.root;
      extraConfig = [ piedsjaloux.apache.vhostConf ];
    };
  };
}