summaryrefslogtreecommitdiff
path: root/modules/private/websites/capitaines
diff options
context:
space:
mode:
Diffstat (limited to 'modules/private/websites/capitaines')
-rw-r--r--modules/private/websites/capitaines/mastodon_static/index.html29
-rw-r--r--modules/private/websites/capitaines/mastodon_static/oops.pngbin0 -> 120305 bytes
-rw-r--r--modules/private/websites/capitaines/production.nix44
3 files changed, 73 insertions, 0 deletions
diff --git a/modules/private/websites/capitaines/mastodon_static/index.html b/modules/private/websites/capitaines/mastodon_static/index.html
new file mode 100644
index 00000000..fae4152d
--- /dev/null
+++ b/modules/private/websites/capitaines/mastodon_static/index.html
@@ -0,0 +1,29 @@
1<!DOCTYPE html>
2<html lang='en'>
3 <head>
4 <meta content='text/html; charset=UTF-8' http-equiv='Content-Type'>
5 <title>This instance is now closed - Mastodon</title>
6 <style>
7 body {
8 text-align: center;
9 background: #282c37;
10 font-family: sans-serif;
11 }
12 img {
13 max-width: 470px;
14 width: 100%;
15 }
16 h1 {
17 font-size: 20px;
18 font-weight: 400;
19 color: #9baec8;
20 }
21 </style>
22 </head>
23 <body>
24 <div>
25 <img alt='Mastodon' src='/oops.png'>
26 <h1>Sorry, this instance is closed now.</h1>
27 </div>
28 </body>
29</html>
diff --git a/modules/private/websites/capitaines/mastodon_static/oops.png b/modules/private/websites/capitaines/mastodon_static/oops.png
new file mode 100644
index 00000000..0abddad3
--- /dev/null
+++ b/modules/private/websites/capitaines/mastodon_static/oops.png
Binary files differ
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, ... }:
2let
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;
8in {
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}