]> git.immae.eu Git - perso/Immae/Config/Nix.git/blame - modules/private/websites/florian/app.nix
Refactor websites options
[perso/Immae/Config/Nix.git] / modules / private / websites / florian / app.nix
CommitLineData
8a964143 1{ lib, pkgs, config, myconfig, ... }:
2f0f1c48 2let
c890321d 3 adminer = pkgs.callPackage ../commons/adminer.nix {};
2f0f1c48 4
f8026b6e 5 tellesflorian = pkgs.callPackage ./builder_app.nix {
8f904d0d 6 inherit (pkgs.webapps) tellesflorian;
c890321d 7 config = myconfig.env.websites.tellesflorian.integration;
f8026b6e
IB
8 apacheUser = config.services.httpd.Inte.user;
9 apacheGroup = config.services.httpd.Inte.group;
c890321d 10 };
2f0f1c48 11
f8026b6e 12 cfg = config.myServices.websites.florian.app;
2f0f1c48 13in {
f8026b6e 14 options.myServices.websites.florian.app.enable = lib.mkEnableOption "enable Florian's app in integration";
2f0f1c48 15
f8026b6e
IB
16 config = lib.mkIf cfg.enable {
17 secrets.keys = tellesflorian.keys;
f40f5b23
IB
18 systemd.services.phpfpm-tellesflorian_dev.after = lib.mkAfter tellesflorian.phpFpm.serviceDeps;
19 systemd.services.phpfpm-tellesflorian_dev.wants = tellesflorian.phpFpm.serviceDeps;
20 systemd.services.phpfpm-tellesflorian_dev.preStart = lib.mkAfter tellesflorian.phpFpm.preStart;
21 services.phpfpm.poolConfigs.tellesflorian_dev = tellesflorian.phpFpm.pool;
f8026b6e 22 system.activationScripts.tellesflorian_dev = tellesflorian.activationScript;
4288c2f2 23 myServices.websites.webappDirs."${tellesflorian.apache.webappName}" = tellesflorian.app.webRoot;
29f8cb85
IB
24 services.websites.env.integration.modules = adminer.apache.modules ++ tellesflorian.apache.modules;
25 services.websites.env.integration.vhostConfs.tellesflorian = {
2f0f1c48 26 certName = "eldiron";
7df420c2 27 addToCerts = true;
2f0f1c48 28 hosts = ["app.tellesflorian.com" ];
f8026b6e 29 root = tellesflorian.apache.root;
2f0f1c48 30 extraConfig = [
f8026b6e 31 tellesflorian.apache.vhostConf
2f0f1c48
IB
32 adminer.apache.vhostConf
33 ];
34 };
17f6eae9
IB
35 services.filesWatcher.phpfpm-tellesflorian_dev = {
36 restart = true;
37 paths = [ "/var/secrets/webapps/${tellesflorian.app.environment}-tellesflorian" ];
38 };
2f0f1c48
IB
39 };
40}