aboutsummaryrefslogtreecommitdiff
path: root/nixops/modules/websites/ftp/temp.nix
blob: 7f9f68160a6ca036378f5280ea2bf2ce7c4b20c8 (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
34
35
36
37
38
39
40
41
{ lib, pkgs, config, myconfig, mylibs, ... }:
let
    cfg = config.services.myWebsites.Temp;
    varDir = "/var/lib/ftp/temp.immae.eu";
    env = myconfig.env.websites.temp;
in {
  options.services.myWebsites.Temp = {
    production = {
      enable = lib.mkEnableOption "enable Temp' website";
    };
  };

  config = lib.mkIf cfg.production.enable {
    security.acme.certs."eldiron".extraDomains."temp.immae.eu" = null;

    services.myWebsites.production.modules = [ "headers" ];
    services.myWebsites.production.vhostConfs.temp = {
      certName    = "eldiron";
      hosts       = [ "temp.immae.eu" ];
      root        = varDir;
      extraConfig = [
        ''
        Use Apaxy "${varDir}" "title .duplicity-ignore"
        <FilesMatch ".+">
          Header set Content-Disposition attachment
        </FilesMatch>
        <Directory "${varDir}">
          Options -Indexes
          AllowOverride None
          Require all granted
        </Directory>

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