aboutsummaryrefslogblamecommitdiff
path: root/modules/private/websites/immae/temp.nix
blob: 288c8cc209461a320989bc0ce89f6cd031d0cff2 (plain) (tree)
1
2
3
4
5
6
7
8
9
                                      
   


                                              
    
                                                                                            
 
                                

                                                             
                              
                         



                                        
                                                       

















                                                   
{ lib, pkgs, config, myconfig,  ... }:
let
  cfg = config.myServices.websites.immae.temp;
  varDir = "/var/lib/ftp/temp.immae.eu";
  env = myconfig.env.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.temp = {
      certName    = "eldiron";
      addToCerts  = true;
      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>
        ''
      ];
    };
  };
}