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