diff options
Diffstat (limited to 'nixops/modules/websites/ftp')
-rw-r--r-- | nixops/modules/websites/ftp/florian.nix | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/nixops/modules/websites/ftp/florian.nix b/nixops/modules/websites/ftp/florian.nix new file mode 100644 index 0000000..9688700 --- /dev/null +++ b/nixops/modules/websites/ftp/florian.nix | |||
@@ -0,0 +1,73 @@ | |||
1 | { lib, pkgs, config, myconfig, mylibs, ... }: | ||
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 | security.acme.certs."florian" = config.services.myCertificates.certConfig // { | ||
21 | domain = "tellesflorian.com"; | ||
22 | extraDomains = { | ||
23 | "www.tellesflorian.com" = null; | ||
24 | }; | ||
25 | }; | ||
26 | |||
27 | services.myWebsites.production.modules = adminer.apache.modules; | ||
28 | services.myWebsites.production.vhostConfs.florian = { | ||
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 | |||
52 | services.myWebsites.integration.modules = adminer.apache.modules; | ||
53 | services.myWebsites.integration.vhostConfs.florian = { | ||
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 | } | ||