]> git.immae.eu Git - perso/Immae/Config/Nix.git/commitdiff
Add capitaines mastodon pages
authorIsmaël Bouya <ismael.bouya@normalesup.org>
Tue, 29 Jan 2019 22:59:49 +0000 (23:59 +0100)
committerIsmaël Bouya <ismael.bouya@normalesup.org>
Tue, 29 Jan 2019 22:59:49 +0000 (23:59 +0100)
nixops/modules/websites/capitaines/default.nix [new file with mode: 0644]
nixops/modules/websites/capitaines/mastodon_static/index.html [new file with mode: 0644]
nixops/modules/websites/capitaines/mastodon_static/oops.png [new file with mode: 0644]
nixops/modules/websites/default.nix

diff --git a/nixops/modules/websites/capitaines/default.nix b/nixops/modules/websites/capitaines/default.nix
new file mode 100644 (file)
index 0000000..7f8f4c6
--- /dev/null
@@ -0,0 +1,34 @@
+{ lib, pkgs, config, myconfig, mylibs, ... }:
+let
+    cfg = config.services.myWebsites.Capitaines;
+    env = myconfig.env.websites.capitaines;
+    siteDir = ./mastodon_static;
+in {
+  options.services.myWebsites.Capitaines = {
+    production = {
+      enable = lib.mkEnableOption "enable Capitaines's website";
+    };
+  };
+
+  config = lib.mkIf cfg.production.enable {
+    security.acme.certs."capitaines_mastodon" = config.services.myCertificates.certConfig // {
+      domain = "mastodon.capitaines.fr";
+    };
+
+    services.myWebsites.production.vhostConfs.capitaines = {
+      certName    = "capitaines_mastodon";
+      hosts       = [ "mastodon.capitaines.fr" ];
+      root        = siteDir;
+      extraConfig = [
+        ''
+        ErrorDocument 404 /index.html
+        <Directory ${siteDir}>
+          DirectoryIndex index.html
+          Options Indexes FollowSymLinks MultiViews Includes
+          Require all granted
+        </Directory>
+          ''
+      ];
+    };
+  };
+}
diff --git a/nixops/modules/websites/capitaines/mastodon_static/index.html b/nixops/modules/websites/capitaines/mastodon_static/index.html
new file mode 100644 (file)
index 0000000..fae4152
--- /dev/null
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html lang='en'>
+  <head>
+    <meta content='text/html; charset=UTF-8' http-equiv='Content-Type'>
+    <title>This instance is now closed - Mastodon</title>
+    <style>
+      body {
+        text-align: center;
+        background: #282c37;
+        font-family: sans-serif;
+      }
+      img {
+        max-width: 470px;
+        width: 100%;
+      }
+      h1 {
+        font-size: 20px;
+        font-weight: 400;
+        color: #9baec8;
+      }
+    </style>
+  </head>
+  <body>
+    <div>
+      <img alt='Mastodon' src='/oops.png'>
+      <h1>Sorry, this instance is closed now.</h1>
+    </div>
+  </body>
+</html>
diff --git a/nixops/modules/websites/capitaines/mastodon_static/oops.png b/nixops/modules/websites/capitaines/mastodon_static/oops.png
new file mode 100644 (file)
index 0000000..0abddad
Binary files /dev/null and b/nixops/modules/websites/capitaines/mastodon_static/oops.png differ
index 7bd1ac5fe89d0ee77dc54c9b825dc50c69288a0e..1093617273c90aa0157047dc98a8b6719b21f7aa 100644 (file)
@@ -92,6 +92,7 @@ in
     ./connexionswing
     ./tellesflorian
     ./emilia
+    ./capitaines
     ./ftp/jerome.nix
     ./ftp/nassime.nix
     ./ftp/florian.nix
@@ -197,6 +198,7 @@ in
     services.myWebsites.Florian.production.enable = cfg.production.enable;
     services.myWebsites.DeniseJerome.production.enable = cfg.production.enable;
     services.myWebsites.Emilia.production.enable = cfg.production.enable;
+    services.myWebsites.Capitaines.production.enable = cfg.production.enable;
 
     services.myWebsites.Chloe.integration.enable = cfg.integration.enable;
     services.myWebsites.Ludivine.integration.enable = cfg.integration.enable;