aboutsummaryrefslogblamecommitdiff
path: root/modules/private/websites/florian/integration.nix
blob: 4ee160a334f9c07aaaa9798c8882cd5f7b997944 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
                            
   
                                                                          

                                                         
                                        



                                                                                                                     
                                                                     
 

                                                                       
                                  



                                                 
                                       













                                                            
{ lib, pkgs, config,  ... }:
let
    adminer = pkgs.callPackage ../commons/adminer.nix { inherit config; };
    cfg = config.myServices.websites.florian.integration;
    varDir = "/var/lib/ftp/florian";
    env = config.myEnv.websites.florian;
in {
  options.myServices.websites.florian.integration.enable = lib.mkEnableOption "enable Florian's website integration";

  config = lib.mkIf cfg.enable {
    security.acme.certs."ftp".extraDomains."florian.immae.eu" = null;

    services.websites.env.integration.modules = adminer.apache.modules;
    services.websites.env.integration.vhostConfs.florian = {
      certName    = "integration";
      addToCerts  = true;
      hosts       = [ "florian.immae.eu" ];
      root        = "${varDir}/florian.immae.eu";
      extraConfig = [
        (adminer.apache.vhostConf null)
        ''
        ServerAdmin ${env.server_admin}

        <Directory ${varDir}/florian.immae.eu>
          DirectoryIndex index.php index.htm index.html
          Options Indexes FollowSymLinks MultiViews Includes
          AllowOverride None
          Require all granted
        </Directory>
          ''
      ];
    };
  };
}