-
Notifications
You must be signed in to change notification settings - Fork 5
/
httpd.nix
50 lines (45 loc) · 1.28 KB
/
httpd.nix
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
{pkgs, config, ...}:
let raskinHomeDir = ''
<Directory /home/raskin/public_html>
Options FollowSymlinks
AllowOverride All
</Directory>
'';
in
{
enable = true;
adminAddr = "[email protected]";
# I trust myself. I can write .htaccess
extraConfig = raskinHomeDir;
hostName = "_default_";
extraModules = [{ name = "php5"; path = "${pkgs.php}/modules/libphp5.so"; }];
virtualHosts =
let
sslFiles = {
sslServerCert = "/var/certs/www/host.cert";
sslServerKey = "/var/certs/www/host.key";
};
homeDirTune = {
enableUserDir = true;
extraConfig = raskinHomeDir;
};
raskinSubDomain = {
hostName = "raskin.${config.networking.hostName}.${config.networking.domain}";
documentRoot = "/home/raskin/public_html" ;
};
mainDomain = {
#hostName = "*";
documentRoot = "/var/www";
};
optionalSSL = localCfg : [
localCfg
(localCfg // sslFiles // {enableSSL=true;})
];
in []
++ (optionalSSL (mainDomain // homeDirTune))
++ (optionalSSL (raskinSubDomain // homeDirTune))
++ (optionalSSL (raskinSubDomain // homeDirTune // {hostName = "raskin";}))
++ (optionalSSL (raskinSubDomain // homeDirTune // {hostName = "raskin-ipv4";}))
;
extraSubservices = [ ];
}