]> git.immae.eu Git - perso/Immae/Config/Nix.git/blame - nixops/modules/websites/piedsjaloux/default.nix
Move Ludivine Piedsjaloux and Florian's websites passwords to a secure location
[perso/Immae/Config/Nix.git] / nixops / modules / websites / piedsjaloux / default.nix
CommitLineData
9d90e7e2 1{ lib, pkgs, config, myconfig, mylibs, ... }:
3013caf1 2let
9d90e7e2
IB
3 piedsjaloux = pkgs.callPackage ./piedsjaloux.nix { inherit (mylibs) fetchedGitPrivate; };
4 piedsjaloux_dev = piedsjaloux {
5 config = myconfig.env.websites.piedsjaloux.integration;
6 };
7 piedsjaloux_prod = piedsjaloux {
8 config = myconfig.env.websites.piedsjaloux.production;
9 };
86f6924f 10
3013caf1
IB
11 cfg = config.services.myWebsites.PiedsJaloux;
12in {
13 options.services.myWebsites.PiedsJaloux = {
14 production = {
15 enable = lib.mkEnableOption "enable PiedsJaloux's website in production";
16 };
17 integration = {
18 enable = lib.mkEnableOption "enable PiedsJaloux's website in integration";
19 };
20 };
21
e4a945cd 22 imports = [
091ae734 23 ../commons/stats.nix
e4a945cd
IB
24 ];
25
3013caf1
IB
26 config = lib.mkMerge [
27 (lib.mkIf cfg.production.enable {
6e23a06b 28 deployment.keys = piedsjaloux_prod.keys;
e4a945cd
IB
29 services.myWebsites.commons.stats.enable = true;
30 services.myWebsites.commons.stats.sites = [
31 {
32 name = "piedsjaloux.fr";
091ae734 33 conf = ./goaccess.conf;
e4a945cd
IB
34 }
35 ];
36
3013caf1
IB
37 security.acme.certs."piedsjaloux" = config.services.myCertificates.certConfig // {
38 domain = "piedsjaloux.fr";
39 extraDomains = {
40 "www.piedsjaloux.fr" = null;
41 };
42 };
86f6924f 43
98584540 44 services.myPhpfpm.poolConfigs.piedsjaloux_prod = piedsjaloux_prod.phpFpm.pool;
86f6924f 45 system.activationScripts.piedsjaloux_prod = piedsjaloux_prod.activationScript;
e5073add
IB
46 system.extraSystemBuilderCmds = ''
47 mkdir -p $out/webapps
48 ln -s ${piedsjaloux_prod.webRoot} $out/webapps/${piedsjaloux_prod.apache.webappName}
49 '';
f8bde3d6
IB
50 services.myWebsites.production.modules = piedsjaloux_prod.apache.modules;
51 services.myWebsites.production.vhostConfs.piedsjaloux = {
52 certName = "piedsjaloux";
53 hosts = [ "piedsjaloux.fr" "www.piedsjaloux.fr" ];
7da3ceec 54 root = piedsjaloux_prod.apache.root;
f8bde3d6
IB
55 extraConfig = [ piedsjaloux_prod.apache.vhostConf ];
56 };
3013caf1
IB
57 })
58 (lib.mkIf cfg.integration.enable {
6e23a06b 59 deployment.keys = piedsjaloux_dev.keys;
3013caf1 60 security.acme.certs."eldiron".extraDomains."piedsjaloux.immae.eu" = null;
98584540 61 services.myPhpfpm.poolConfigs.piedsjaloux_dev = piedsjaloux_dev.phpFpm.pool;
86f6924f 62 system.activationScripts.piedsjaloux_dev = piedsjaloux_dev.activationScript;
e5073add
IB
63 system.extraSystemBuilderCmds = ''
64 mkdir -p $out/webapps
65 ln -s ${piedsjaloux_dev.webRoot} $out/webapps/${piedsjaloux_dev.apache.webappName}
66 '';
f8bde3d6
IB
67 services.myWebsites.integration.modules = piedsjaloux_dev.apache.modules;
68 services.myWebsites.integration.vhostConfs.piedsjaloux = {
69 certName = "eldiron";
70 hosts = [ "piedsjaloux.immae.eu" ];
e5073add 71 root = piedsjaloux_dev.apache.root;
f8bde3d6
IB
72 extraConfig = [ piedsjaloux_dev.apache.vhostConf ];
73 };
3013caf1
IB
74 })
75 ];
76}
77