]> git.immae.eu Git - perso/Immae/Config/Nix.git/blob - nixops/modules/websites/ftp/nassime.nix
Add Nassime's website
[perso/Immae/Config/Nix.git] / nixops / modules / websites / ftp / nassime.nix
1 { lib, pkgs, config, myconfig, mylibs, ... }:
2 let
3 cfg = config.services.myWebsites.Nassime;
4 varDir = "/var/lib/ftp/nassime";
5 env = myconfig.env.websites.nassime;
6 in {
7 options.services.myWebsites.Nassime = {
8 production = {
9 enable = lib.mkEnableOption "enable Nassime's website";
10 };
11 };
12
13 imports = [
14 ../commons/stats.nix
15 ];
16
17 config = lib.mkIf cfg.production.enable {
18 services.myWebsites.commons.stats.enable = true;
19 services.myWebsites.commons.stats.sites = [
20 {
21 name = "nassime.bouya.org";
22 conf = ./nassime_goaccess.conf;
23 }
24 ];
25
26 security.acme.certs."ftp".extraDomains."nassime.bouya.org" = null;
27 security.acme.certs."nassime" = config.services.myCertificates.certConfig // {
28 domain = "nassime.bouya.org";
29 };
30
31 services.myWebsites.production.vhostConfs.nassime = {
32 certName = "nassime";
33 hosts = ["nassime.bouya.org" ];
34 root = varDir;
35 extraConfig = [
36 ''
37 Use Stats nassime.bouya.org
38 ServerAdmin ${env.server_admin}
39
40 <Directory ${varDir}>
41 DirectoryIndex index.php index.htm index.html
42 Options Indexes FollowSymLinks MultiViews Includes
43 AllowOverride None
44 Require all granted
45 </Directory>
46 ''
47 ];
48 };
49 };
50 }