aboutsummaryrefslogtreecommitdiff
path: root/modules/private/websites/nassime/production.nix
blob: 1179351fb3166d781c6c1902f77fd46c5e1fc84f (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
{ lib, pkgs, config,  ... }:
let
  cfg = config.myServices.websites.nassime.production;
  varDir = "/var/lib/ftp/nassime";
  env = config.myEnv.websites.nassime;
  domain = "nassime.bouya.org";
in {
  options.myServices.websites.nassime.production.enable = lib.mkEnableOption "enable Nassime's website";

  config = lib.mkIf cfg.enable {
    services.webstats.sites = [ { name = domain; } ];

    security.acme.certs."ftp".extraDomains."${domain}" = null;

    services.websites.env.production.vhostConfs.nassime = {
      certName     = "nassime";
      certMainHost = domain;
      hosts        = [ domain ];
      root         = varDir;
      extraConfig  = [
        ''
        Use Stats ${domain}
        ServerAdmin ${env.server_admin}

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