]>
Commit | Line | Data |
---|---|---|
8a964143 | 1 | { lib, pkgs, config, myconfig, ... }: |
79f239be IB |
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; | |
79f239be | 20 | |
daf64e3f IB |
21 | services.websites.production.modules = adminer.apache.modules; |
22 | services.websites.production.vhostConfs.florian = { | |
7df420c2 IB |
23 | certName = "florian"; |
24 | certMainHost = "tellesflorian.com"; | |
25 | hosts = [ "tellesflorian.com" "www.tellesflorian.com" ]; | |
26 | root = "${varDir}/tellesflorian.com"; | |
27 | extraConfig = [ | |
79f239be IB |
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; | |
79f239be | 45 | |
daf64e3f IB |
46 | services.websites.integration.modules = adminer.apache.modules; |
47 | services.websites.integration.vhostConfs.florian = { | |
79f239be | 48 | certName = "eldiron"; |
7df420c2 | 49 | addToCerts = true; |
79f239be IB |
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 | } |