]> git.immae.eu Git - perso/Immae/Config/Nix.git/blob - nixops/modules/websites/tellesflorian/default.nix
Move integration websites to use stable web directory
[perso/Immae/Config/Nix.git] / nixops / modules / websites / tellesflorian / default.nix
1 { lib, pkgs, config, myconfig, mylibs, ... }:
2 let
3 adminer = pkgs.callPackage ../commons/adminer.nix {};
4
5 tellesflorian = pkgs.callPackage ./tellesflorian.nix { inherit (mylibs) fetchedGitPrivate; };
6 tellesflorian_dev = tellesflorian {
7 config = myconfig.env.websites.tellesflorian.integration;
8 };
9
10 cfg = config.services.myWebsites.TellesFlorian;
11 in {
12 options.services.myWebsites.TellesFlorian = {
13 integration = {
14 enable = lib.mkEnableOption "enable Florian Telles's website in integration";
15 };
16 };
17
18 config = lib.mkIf cfg.integration.enable {
19 security.acme.certs."eldiron".extraDomains."app.tellesflorian.com" = null;
20 services.myPhpfpm.poolConfigs.tellesflorian_dev = tellesflorian_dev.phpFpm.pool;
21 system.activationScripts.tellesflorian_dev = tellesflorian_dev.activationScript;
22 system.extraSystemBuilderCmds = ''
23 mkdir -p $out/webapps
24 ln -s ${tellesflorian_dev.webRoot} $out/webapps/${tellesflorian_dev.apache.webappName}
25 '';
26 services.myWebsites.integration.modules = adminer.apache.modules ++ tellesflorian_dev.apache.modules;
27 services.myWebsites.integration.vhostConfs.tellesflorian = {
28 certName = "eldiron";
29 hosts = ["app.tellesflorian.com" ];
30 root = tellesflorian_dev.apache.root;
31 extraConfig = [
32 tellesflorian_dev.apache.vhostConf
33 adminer.apache.vhostConf
34 ];
35 };
36 };
37 }