]> git.immae.eu Git - perso/Immae/Config/Nix.git/blame - nixops/modules/websites/ftp/florian.nix
Start moving websites configuration to modules
[perso/Immae/Config/Nix.git] / nixops / modules / websites / ftp / florian.nix
CommitLineData
8a964143 1{ lib, pkgs, config, myconfig, ... }:
79f239be
IB
2let
3 adminer = pkgs.callPackage ../commons/adminer.nix {};
4 cfg = config.services.myWebsites.Florian;
5 varDir = "/var/lib/ftp/florian";
6 env = myconfig.env.websites.florian;
7in {
8 options.services.myWebsites.Florian = {
9 production = {
10 enable = lib.mkEnableOption "enable Florian's website production";
11 };
12 integration = {
13 enable = lib.mkEnableOption "enable Florian's website integration";
14 };
15 };
16
17 config = lib.mkMerge [
18 (lib.mkIf cfg.production.enable {
19 security.acme.certs."ftp".extraDomains."tellesflorian.com" = null;
20 security.acme.certs."florian" = config.services.myCertificates.certConfig // {
21 domain = "tellesflorian.com";
22 extraDomains = {
23 "www.tellesflorian.com" = null;
24 };
25 };
26
daf64e3f
IB
27 services.websites.production.modules = adminer.apache.modules;
28 services.websites.production.vhostConfs.florian = {
79f239be
IB
29 certName = "florian";
30 hosts = [ "tellesflorian.com" "www.tellesflorian.com" ];
31 root = "${varDir}/tellesflorian.com";
32 extraConfig = [
33 adminer.apache.vhostConf
34 ''
35 ServerAdmin ${env.server_admin}
36
37 <Directory ${varDir}/tellesflorian.com>
38 DirectoryIndex index.php index.htm index.html
39 Options Indexes FollowSymLinks MultiViews Includes
40 AllowOverride None
41 Require all granted
42 </Directory>
43 ''
44 ];
45 };
46 })
47
48 (lib.mkIf cfg.integration.enable {
49 security.acme.certs."ftp".extraDomains."florian.immae.eu" = null;
50 security.acme.certs."eldiron".extraDomains."florian.immae.eu" = null;
51
daf64e3f
IB
52 services.websites.integration.modules = adminer.apache.modules;
53 services.websites.integration.vhostConfs.florian = {
79f239be
IB
54 certName = "eldiron";
55 hosts = [ "florian.immae.eu" ];
56 root = "${varDir}/florian.immae.eu";
57 extraConfig = [
58 adminer.apache.vhostConf
59 ''
60 ServerAdmin ${env.server_admin}
61
62 <Directory ${varDir}/florian.immae.eu>
63 DirectoryIndex index.php index.htm index.html
64 Options Indexes FollowSymLinks MultiViews Includes
65 AllowOverride None
66 Require all granted
67 </Directory>
68 ''
69 ];
70 };
71 })
72 ];
73}