]> git.immae.eu Git - perso/Immae/Config/Nix.git/blob - nixops/modules/websites/ftp/florian.nix
Remove direct dependency to myconfig in database modules
[perso/Immae/Config/Nix.git] / nixops / modules / websites / ftp / florian.nix
1 { lib, pkgs, config, myconfig, ... }:
2 let
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;
7 in {
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
21 services.websites.production.modules = adminer.apache.modules;
22 services.websites.production.vhostConfs.florian = {
23 certName = "florian";
24 certMainHost = "tellesflorian.com";
25 hosts = [ "tellesflorian.com" "www.tellesflorian.com" ];
26 root = "${varDir}/tellesflorian.com";
27 extraConfig = [
28 adminer.apache.vhostConf
29 ''
30 ServerAdmin ${env.server_admin}
31
32 <Directory ${varDir}/tellesflorian.com>
33 DirectoryIndex index.php index.htm index.html
34 Options Indexes FollowSymLinks MultiViews Includes
35 AllowOverride None
36 Require all granted
37 </Directory>
38 ''
39 ];
40 };
41 })
42
43 (lib.mkIf cfg.integration.enable {
44 security.acme.certs."ftp".extraDomains."florian.immae.eu" = null;
45
46 services.websites.integration.modules = adminer.apache.modules;
47 services.websites.integration.vhostConfs.florian = {
48 certName = "eldiron";
49 addToCerts = true;
50 hosts = [ "florian.immae.eu" ];
51 root = "${varDir}/florian.immae.eu";
52 extraConfig = [
53 adminer.apache.vhostConf
54 ''
55 ServerAdmin ${env.server_admin}
56
57 <Directory ${varDir}/florian.immae.eu>
58 DirectoryIndex index.php index.htm index.html
59 Options Indexes FollowSymLinks MultiViews Includes
60 AllowOverride None
61 Require all granted
62 </Directory>
63 ''
64 ];
65 };
66 })
67 ];
68 }