]> git.immae.eu Git - perso/Immae/Config/Nix.git/blob - modules/private/websites/capitaines/production.nix
Remove direct dependency to myconfig in database modules
[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 system.extraSystemBuilderCmds = ''
13 mkdir -p $out/webapps
14 ln -s ${siteDir} $out/webapps/${webappName}
15 '';
16
17 services.websites.production.vhostConfs.capitaines_mastodon = {
18 certName = "capitaines";
19 certMainHost = "mastodon.capitaines.fr";
20 hosts = [ "mastodon.capitaines.fr" ];
21 root = root;
22 extraConfig = [
23 ''
24 ErrorDocument 404 /index.html
25 <Directory ${root}>
26 DirectoryIndex index.html
27 Options Indexes FollowSymLinks MultiViews Includes
28 Require all granted
29 </Directory>
30 ''
31 ];
32 };
33
34 services.websites.production.vhostConfs.capitaines = {
35 certName = "capitaines";
36 addToCerts = true;
37 hosts = [ "capitaines.fr" ];
38 root = "/run/current-system/webapps/_www";
39 extraConfig = [ ''
40 <Directory /run/current-system/webapps/_www>
41 DirectoryIndex index.htm
42 Require all granted
43 </Directory>
44 '' ];
45 };
46 };
47 }