]> git.immae.eu Git - perso/Immae/Config/Nix.git/blob - modules/private/websites/capitaines/production.nix
57d878737a42eef9ed0c114990d7d02dae0ce06e
[perso/Immae/Config/Nix.git] / modules / private / websites / capitaines / production.nix
1 { lib, pkgs, config, myconfig, ... }:
2 let
3 cfg = config.myServices.websites.capitaines.production;
4 env = myconfig.env.websites.capitaines;
5 webappName = "capitaines_mastodon";
6 root = "/run/current-system/webapps/${webappName}";
7 siteDir = ./mastodon_static;
8 in {
9 options.myServices.websites.capitaines.production.enable = lib.mkEnableOption "enable Capitaines's website";
10
11 config = lib.mkIf cfg.enable {
12 myServices.websites.webappDirs."${webappName}" = siteDir;
13
14 services.websites.production.vhostConfs.capitaines_mastodon = {
15 certName = "capitaines";
16 certMainHost = "mastodon.capitaines.fr";
17 hosts = [ "mastodon.capitaines.fr" ];
18 root = root;
19 extraConfig = [
20 ''
21 ErrorDocument 404 /index.html
22 <Directory ${root}>
23 DirectoryIndex index.html
24 Options Indexes FollowSymLinks MultiViews Includes
25 Require all granted
26 </Directory>
27 ''
28 ];
29 };
30
31 services.websites.production.vhostConfs.capitaines = {
32 certName = "capitaines";
33 addToCerts = true;
34 hosts = [ "capitaines.fr" ];
35 root = "/run/current-system/webapps/_www";
36 extraConfig = [ ''
37 <Directory /run/current-system/webapps/_www>
38 DirectoryIndex index.htm
39 Require all granted
40 </Directory>
41 '' ];
42 };
43 };
44 }