aboutsummaryrefslogtreecommitdiff
path: root/modules/private/websites/nath
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2021-04-03 19:19:05 +0200
committerIsmaël Bouya <ismael.bouya@normalesup.org>2021-04-03 19:19:05 +0200
commit87949cb97f78dad19743352a584af432a4800e03 (patch)
tree1125e04b7da8715d379f09e6c32379524ef98095 /modules/private/websites/nath
parentc081a03a97780afd845e017f279e0f1e96a86c8a (diff)
downloadNix-87949cb97f78dad19743352a584af432a4800e03.tar.gz
Nix-87949cb97f78dad19743352a584af432a4800e03.tar.zst
Nix-87949cb97f78dad19743352a584af432a4800e03.zip
Change Nath’s name
Diffstat (limited to 'modules/private/websites/nath')
-rw-r--r--modules/private/websites/nath/villon.nix42
1 files changed, 42 insertions, 0 deletions
diff --git a/modules/private/websites/nath/villon.nix b/modules/private/websites/nath/villon.nix
new file mode 100644
index 0000000..57a1df5
--- /dev/null
+++ b/modules/private/websites/nath/villon.nix
@@ -0,0 +1,42 @@
1{ lib, pkgs, config, ... }:
2let
3 cfg = config.myServices.websites.nath.villon;
4 varDir = "/var/lib/ftp/nath";
5 env = config.myEnv.websites.nath;
6 domain = "sntvillon.immae.eu";
7 apacheUser = config.services.httpd.Prod.user;
8 apacheGroup = config.services.httpd.Prod.group;
9in {
10 options.myServices.websites.nath.villon.enable = lib.mkEnableOption "enable Nath's website";
11
12 config = lib.mkIf cfg.enable {
13 services.webstats.sites = [ { name = domain; } ];
14
15 system.activationScripts.nath_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.nath_villon = {
24 certName = "nath";
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}