aboutsummaryrefslogtreecommitdiff
path: root/modules/private/websites/florian/production.nix
blob: 16c6022888357c61f8ce4e9936c2aa148c9b4bd5 (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
{ lib, pkgs, config,  ... }:
let
    adminer = pkgs.callPackage ../commons/adminer.nix { inherit config; };
    cfg = config.myServices.websites.florian.production;
    varDir = "/var/lib/ftp/florian";
    env = config.myEnv.websites.florian;
in {
  options.myServices.websites.florian.production.enable = lib.mkEnableOption "enable Florian's website production";

  config = lib.mkIf cfg.enable {
    security.acme.certs."ftp".extraDomains."tellesflorian.com" = null;

    services.websites.env.production.modules = adminer.apache.modules;
    services.websites.env.production.vhostConfs.florian = {
      certName     = "florian";
      certMainHost = "tellesflorian.com";
      hosts        = [ "tellesflorian.com" "www.tellesflorian.com" ];
      root         = "${varDir}/tellesflorian.com";
      extraConfig  = [
        (adminer.apache.vhostConf null)
        ''
        ServerAdmin ${env.server_admin}

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