aboutsummaryrefslogtreecommitdiff
path: root/modules/private/websites/capitaines/production.nix
diff options
context:
space:
mode:
Diffstat (limited to 'modules/private/websites/capitaines/production.nix')
-rw-r--r--modules/private/websites/capitaines/production.nix34
1 files changed, 26 insertions, 8 deletions
diff --git a/modules/private/websites/capitaines/production.nix b/modules/private/websites/capitaines/production.nix
index 044ff1d..ee1698b 100644
--- a/modules/private/websites/capitaines/production.nix
+++ b/modules/private/websites/capitaines/production.nix
@@ -1,17 +1,15 @@
1{ lib, pkgs, config, ... }: 1{ lib, pkgs, config, ... }:
2let 2let
3 cfg = config.myServices.websites.capitaines.production; 3 cfg = config.myServices.websites.capitaines.production;
4 env = config.myEnv.websites.capitaines; 4 env = config.myEnv.websites.capitaines;
5 webappName = "capitaines_mastodon";
6 root = "/run/current-system/webapps/${webappName}";
7 siteDir = ./mastodon_static;
8in { 5in {
9 options.myServices.websites.capitaines.production.enable = lib.mkEnableOption "enable Capitaines's website"; 6 options.myServices.websites.capitaines.production.enable = lib.mkEnableOption "enable Capitaines's website";
10 7
11 config = lib.mkIf cfg.enable { 8 config = lib.mkIf cfg.enable {
12 myServices.websites.webappDirs."${webappName}" = siteDir; 9 myServices.websites.webappDirs.capitaines_mastodon = ./mastodon_static;
13 10 services.websites.env.production.vhostConfs.capitaines_mastodon = let
14 services.websites.env.production.vhostConfs.capitaines_mastodon = { 11 root = "/run/current-system/webapps/capitaines_mastodon";
12 in {
15 certName = "capitaines"; 13 certName = "capitaines";
16 certMainHost = "mastodon.capitaines.fr"; 14 certMainHost = "mastodon.capitaines.fr";
17 hosts = [ "mastodon.capitaines.fr" ]; 15 hosts = [ "mastodon.capitaines.fr" ];
@@ -28,6 +26,26 @@ in {
28 ]; 26 ];
29 }; 27 };
30 28
29 myServices.websites.webappDirs.capitaines_discourse = ./discourse_static;
30 services.websites.env.production.vhostConfs.capitaines_discourse = let
31 root = "/run/current-system/webapps/capitaines_discourse";
32 in {
33 certName = "capitaines";
34 addToCerts = true;
35 hosts = [ "discourse.capitaines.fr" ];
36 root = root;
37 extraConfig = [
38 ''
39 ErrorDocument 404 /index.html
40 <Directory ${root}>
41 DirectoryIndex index.html
42 Options Indexes FollowSymLinks MultiViews Includes
43 Require all granted
44 </Directory>
45 ''
46 ];
47 };
48
31 services.websites.env.production.vhostConfs.capitaines = { 49 services.websites.env.production.vhostConfs.capitaines = {
32 certName = "capitaines"; 50 certName = "capitaines";
33 addToCerts = true; 51 addToCerts = true;