aboutsummaryrefslogtreecommitdiff
path: root/modules/private/websites/immae/temp.nix
blob: c24844e25f75d8d250f830b3927ea96fa927e61a (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
{ lib, pkgs, config,  ... }:
let
  cfg = config.myServices.websites.immae.temp;
  varDir = "/var/lib/ftp/temp.immae.eu";
  env = config.myEnv.websites.temp;
in {
  options.myServices.websites.immae.temp.enable = lib.mkEnableOption "enable Temp' website";

  config = lib.mkIf cfg.enable {
    services.websites.env.production.modules = [ "headers" ];
    services.websites.env.production.vhostConfs.immae_temp = {
      certName    = "immae";
      addToCerts  = true;
      hosts       = [ "temp.immae.eu" ];
      root        = varDir;
      extraConfig = [
        ''
        Use Apaxy "${varDir}" "title .duplicity-ignore"
        <Directory "${varDir}">
          Options -Indexes
          AllowOverride None
          Require all granted
        </Directory>

        <DirectoryMatch "${varDir}/(.+)">
          Options Indexes
        </DirectoryMatch>
        ''
      ];
    };
  };
}