aboutsummaryrefslogtreecommitdiff
path: root/modules/private/websites/capitaines
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2020-01-05 20:18:32 +0100
committerIsmaël Bouya <ismael.bouya@normalesup.org>2020-01-05 20:18:32 +0100
commitedba35fea979ba470d7b802bbf3a69749f37b5de (patch)
tree118b76be29edecb4effd3d56e5bb80cc52052d6d /modules/private/websites/capitaines
parent2a3d1941c30354c0592a50958f1c15108a5bcb9b (diff)
downloadNix-edba35fea979ba470d7b802bbf3a69749f37b5de.tar.gz
Nix-edba35fea979ba470d7b802bbf3a69749f37b5de.tar.zst
Nix-edba35fea979ba470d7b802bbf3a69749f37b5de.zip
Add discourse capitaine landing page
Diffstat (limited to 'modules/private/websites/capitaines')
-rw-r--r--modules/private/websites/capitaines/discourse_static/discourse.pngbin0 -> 2440 bytes
-rw-r--r--modules/private/websites/capitaines/discourse_static/index.html28
-rw-r--r--modules/private/websites/capitaines/production.nix34
3 files changed, 54 insertions, 8 deletions
diff --git a/modules/private/websites/capitaines/discourse_static/discourse.png b/modules/private/websites/capitaines/discourse_static/discourse.png
new file mode 100644
index 0000000..91ce42d
--- /dev/null
+++ b/modules/private/websites/capitaines/discourse_static/discourse.png
Binary files differ
diff --git a/modules/private/websites/capitaines/discourse_static/index.html b/modules/private/websites/capitaines/discourse_static/index.html
new file mode 100644
index 0000000..4c2ead0
--- /dev/null
+++ b/modules/private/websites/capitaines/discourse_static/index.html
@@ -0,0 +1,28 @@
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 - Discourse</title>
6 <style>
7 body {
8 text-align: center;
9 background: #f9f9f9;
10 font-family: sans-serif;
11 }
12 img {
13 max-width: 235px;
14 width: 100%;
15 }
16 h1 {
17 font-size: 20px;
18 font-weight: 400;
19 }
20 </style>
21 </head>
22 <body>
23 <div>
24 <img alt='Discourse capitaines' src='/discourse.png'>
25 <h1>Sorry, this instance is closed now.</h1>
26 </div>
27 </body>
28</html>
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;