]> git.immae.eu Git - perso/Immae/Config/Nix.git/blame - modules/private/websites/aten/integration.nix
Add a filesWatcher service to restart them when secrets change
[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 {
15 secrets.keys = aten.keys;
f40f5b23
IB
16 systemd.services.phpfpm-aten_dev.preStart = lib.mkAfter aten.phpFpm.preStart;
17 systemd.services.phpfpm-aten_dev.after = lib.mkAfter aten.phpFpm.serviceDeps;
18 systemd.services.phpfpm-aten_dev.wants = aten.phpFpm.serviceDeps;
19 services.phpfpm.poolConfigs.aten_dev = aten.phpFpm.pool;
f8026b6e 20 system.activationScripts.aten_dev = aten.activationScript;
4288c2f2 21 myServices.websites.webappDirs."${aten.apache.webappName}" = aten.app.webRoot;
f8026b6e
IB
22 services.websites.integration.modules = aten.apache.modules;
23 services.websites.integration.vhostConfs.aten = {
24 certName = "eldiron";
25 addToCerts = true;
26 hosts = [ "dev.aten.pro" ];
27 root = aten.apache.root;
28 extraConfig = [ aten.apache.vhostConf ];
29 };
17f6eae9
IB
30 services.websites.integration.watchPaths = [
31 "/var/secrets/webapps/${aten.app.environment}-aten"
32 ];
f8026b6e
IB
33 };
34}
35