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