aboutsummaryrefslogtreecommitdiff
path: root/modules/private/websites/capitaines
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2019-05-18 10:49:00 +0200
committerIsmaël Bouya <ismael.bouya@normalesup.org>2019-05-18 10:49:00 +0200
commitf8026b6e4c869aa108f6361c8ccd50890657994d (patch)
tree57cb311e520933bd2ab6ccbae05f2913799eb49e /modules/private/websites/capitaines
parent4aac110f17f0528d90510eec00c9a8df60bcf04f (diff)
downloadNix-f8026b6e4c869aa108f6361c8ccd50890657994d.tar.gz
Nix-f8026b6e4c869aa108f6361c8ccd50890657994d.tar.zst
Nix-f8026b6e4c869aa108f6361c8ccd50890657994d.zip
Move personal websites to modules
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.nix47
3 files changed, 76 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 0000000..fae4152
--- /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 0000000..0abddad
--- /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 0000000..fe9c619
--- /dev/null
+++ b/modules/private/websites/capitaines/production.nix
@@ -0,0 +1,47 @@
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 system.extraSystemBuilderCmds = ''
13 mkdir -p $out/webapps
14 ln -s ${siteDir} $out/webapps/${webappName}
15 '';
16
17 services.websites.production.vhostConfs.capitaines_mastodon = {
18 certName = "capitaines";
19 certMainHost = "mastodon.capitaines.fr";
20 hosts = [ "mastodon.capitaines.fr" ];
21 root = root;
22 extraConfig = [
23 ''
24 ErrorDocument 404 /index.html
25 <Directory ${root}>
26 DirectoryIndex index.html
27 Options Indexes FollowSymLinks MultiViews Includes
28 Require all granted
29 </Directory>
30 ''
31 ];
32 };
33
34 services.websites.production.vhostConfs.capitaines = {
35 certName = "capitaines";
36 addToCerts = true;
37 hosts = [ "capitaines.fr" ];
38 root = "/run/current-system/webapps/_www";
39 extraConfig = [ ''
40 <Directory /run/current-system/webapps/_www>
41 DirectoryIndex index.htm
42 Require all granted
43 </Directory>
44 '' ];
45 };
46 };
47}