diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2020-04-23 13:02:52 +0200 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2020-04-23 13:02:52 +0200 |
commit | 8722d69346d5cee802e205e18a2b23d3d4fb4805 (patch) | |
tree | db1125e70715b7b9e146472c7211bd7375d25824 /modules/private/websites/nathanael | |
parent | d10ecf142347c037a9359f88f5830796e9f9218c (diff) | |
download | Nix-8722d69346d5cee802e205e18a2b23d3d4fb4805.tar.gz Nix-8722d69346d5cee802e205e18a2b23d3d4fb4805.tar.zst Nix-8722d69346d5cee802e205e18a2b23d3d4fb4805.zip |
Add website for Nathanael
Diffstat (limited to 'modules/private/websites/nathanael')
-rw-r--r-- | modules/private/websites/nathanael/villon.nix | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/modules/private/websites/nathanael/villon.nix b/modules/private/websites/nathanael/villon.nix new file mode 100644 index 0000000..7482de1 --- /dev/null +++ b/modules/private/websites/nathanael/villon.nix | |||
@@ -0,0 +1,42 @@ | |||
1 | { lib, pkgs, config, ... }: | ||
2 | let | ||
3 | cfg = config.myServices.websites.nathanael.villon; | ||
4 | varDir = "/var/lib/ftp/nathanael"; | ||
5 | env = config.myEnv.websites.nathanael; | ||
6 | domain = "sntvillon.immae.eu"; | ||
7 | apacheUser = config.services.httpd.Prod.user; | ||
8 | apacheGroup = config.services.httpd.Prod.group; | ||
9 | in { | ||
10 | options.myServices.websites.nathanael.villon.enable = lib.mkEnableOption "enable Nathanael's website"; | ||
11 | |||
12 | config = lib.mkIf cfg.enable { | ||
13 | services.webstats.sites = [ { name = domain; } ]; | ||
14 | |||
15 | system.activationScripts.nathanael_villon = { | ||
16 | deps = [ "users" ]; | ||
17 | text = '' | ||
18 | install -m 0755 -o ${apacheUser} -g ${apacheGroup} -d ${varDir} | ||
19 | ''; | ||
20 | }; | ||
21 | security.acme.certs."ftp".extraDomains."${domain}" = null; | ||
22 | |||
23 | services.websites.env.production.vhostConfs.nathanael_villon = { | ||
24 | certName = "nathanael"; | ||
25 | certMainHost = domain; | ||
26 | hosts = [ domain ]; | ||
27 | root = varDir; | ||
28 | extraConfig = [ | ||
29 | '' | ||
30 | Use Stats ${domain} | ||
31 | |||
32 | <Directory ${varDir}> | ||
33 | DirectoryIndex index.htm index.html | ||
34 | Options Indexes FollowSymLinks MultiViews Includes | ||
35 | AllowOverride None | ||
36 | Require all granted | ||
37 | </Directory> | ||
38 | '' | ||
39 | ]; | ||
40 | }; | ||
41 | }; | ||
42 | } | ||