diff options
Diffstat (limited to 'modules/private/websites/capitaines/production.nix')
-rw-r--r-- | modules/private/websites/capitaines/production.nix | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/modules/private/websites/capitaines/production.nix b/modules/private/websites/capitaines/production.nix new file mode 100644 index 00000000..57d87873 --- /dev/null +++ b/modules/private/websites/capitaines/production.nix | |||
@@ -0,0 +1,44 @@ | |||
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 | } | ||