]> git.immae.eu Git - perso/Immae/Config/Nix.git/blob - modules/private/websites/immae/temp.nix
0b2a3a3ed56f4210321f492c7d74642b2abaa264
[perso/Immae/Config/Nix.git] / modules / private / websites / immae / temp.nix
1 { lib, pkgs, config, myconfig, ... }:
2 let
3 cfg = config.myServices.websites.immae.temp;
4 varDir = "/var/lib/ftp/temp.immae.eu";
5 env = myconfig.env.websites.temp;
6 in {
7 options.myServices.websites.immae.temp.enable = lib.mkEnableOption "enable Temp' website";
8
9 config = lib.mkIf cfg.enable {
10 services.websites.production.modules = [ "headers" ];
11 services.websites.production.vhostConfs.temp = {
12 certName = "eldiron";
13 addToCerts = true;
14 hosts = [ "temp.immae.eu" ];
15 root = varDir;
16 extraConfig = [
17 ''
18 Use Apaxy "${varDir}" "title .duplicity-ignore"
19 <FilesMatch ".+">
20 Header set Content-Disposition attachment
21 </FilesMatch>
22 <Directory "${varDir}">
23 Options -Indexes
24 AllowOverride None
25 Require all granted
26 </Directory>
27
28 <DirectoryMatch "${varDir}/(.+)">
29 Options Indexes
30 </DirectoryMatch>
31 ''
32 ];
33 };
34 };
35 }
36