]> git.immae.eu Git - perso/Immae/Config/Nix.git/blob - modules/private/websites/ludivinecassal/production.nix
9d8407de3e9b8a8d4b685f0e329bf397d57c9f03
[perso/Immae/Config/Nix.git] / modules / private / websites / ludivinecassal / production.nix
1 { lib, pkgs, config, myconfig, ... }:
2 let
3 ludivinecassal = pkgs.callPackage ./builder.nix {
4 inherit (pkgs.webapps) ludivinecassal;
5 config = myconfig.env.websites.ludivinecassal.production;
6 apacheUser = config.services.httpd.Prod.user;
7 apacheGroup = config.services.httpd.Prod.group;
8 };
9
10 cfg = config.myServices.websites.ludivinecassal.production;
11 in {
12 options.myServices.websites.ludivinecassal.production.enable = lib.mkEnableOption "enable Ludivine's website in production";
13
14 config = lib.mkIf cfg.enable {
15 secrets.keys = ludivinecassal.keys;
16 services.webstats.sites = [ { name = "ludivinecassal.com"; } ];
17
18 systemd.services.phpfpm-ludivinecassal_prod.after = lib.mkAfter ludivinecassal.phpFpm.serviceDeps;
19 systemd.services.phpfpm-ludivinecassal_prod.wants = ludivinecassal.phpFpm.serviceDeps;
20 systemd.services.phpfpm-ludivinecassal_prod.preStart = lib.mkAfter ludivinecassal.phpFpm.preStart;
21 services.phpfpm.poolConfigs.ludivinecassal_prod = ludivinecassal.phpFpm.pool;
22 system.activationScripts.ludivinecassal_prod = ludivinecassal.activationScript;
23 myServices.websites.webappDirs."${ludivinecassal.apache.webappName}" = ludivinecassal.app.webRoot;
24 services.websites.env.production.modules = ludivinecassal.apache.modules;
25 services.websites.env.production.vhostConfs.ludivine = {
26 certName = "ludivinecassal";
27 certMainHost = "ludivinecassal.com";
28 hosts = ["ludivinecassal.com" "www.ludivinecassal.com" ];
29 root = ludivinecassal.apache.root;
30 extraConfig = [ ludivinecassal.apache.vhostConf ];
31 };
32 services.filesWatcher.phpfpm-ludivinecassal_prod = {
33 restart = true;
34 paths = [ "/var/secrets/webapps/${ludivinecassal.app.environment}-ludivinecassal" ];
35 };
36 };
37 }