aboutsummaryrefslogtreecommitdiff
path: root/nixops/modules/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 /nixops/modules/websites/capitaines
parent4aac110f17f0528d90510eec00c9a8df60bcf04f (diff)
downloadNix-f8026b6e4c869aa108f6361c8ccd50890657994d.tar.gz
Nix-f8026b6e4c869aa108f6361c8ccd50890657994d.tar.zst
Nix-f8026b6e4c869aa108f6361c8ccd50890657994d.zip
Move personal websites to modules
Diffstat (limited to 'nixops/modules/websites/capitaines')
-rw-r--r--nixops/modules/websites/capitaines/default.nix51
-rw-r--r--nixops/modules/websites/capitaines/mastodon_static/index.html29
-rw-r--r--nixops/modules/websites/capitaines/mastodon_static/oops.pngbin120305 -> 0 bytes
3 files changed, 0 insertions, 80 deletions
diff --git a/nixops/modules/websites/capitaines/default.nix b/nixops/modules/websites/capitaines/default.nix
deleted file mode 100644
index 4bbf488..0000000
--- a/nixops/modules/websites/capitaines/default.nix
+++ /dev/null
@@ -1,51 +0,0 @@
1{ lib, pkgs, config, myconfig, ... }:
2let
3 cfg = config.services.myWebsites.Capitaines;
4 env = myconfig.env.websites.capitaines;
5 webappName = "capitaines_mastodon";
6 root = "/run/current-system/webapps/${webappName}";
7 siteDir = ./mastodon_static;
8in {
9 options.services.myWebsites.Capitaines = {
10 production = {
11 enable = lib.mkEnableOption "enable Capitaines's website";
12 };
13 };
14
15 config = lib.mkIf cfg.production.enable {
16 system.extraSystemBuilderCmds = ''
17 mkdir -p $out/webapps
18 ln -s ${siteDir} $out/webapps/${webappName}
19 '';
20
21 services.websites.production.vhostConfs.capitaines_mastodon = {
22 certName = "capitaines";
23 certMainHost = "mastodon.capitaines.fr";
24 hosts = [ "mastodon.capitaines.fr" ];
25 root = root;
26 extraConfig = [
27 ''
28 ErrorDocument 404 /index.html
29 <Directory ${root}>
30 DirectoryIndex index.html
31 Options Indexes FollowSymLinks MultiViews Includes
32 Require all granted
33 </Directory>
34 ''
35 ];
36 };
37
38 services.websites.production.vhostConfs.capitaines = {
39 certName = "capitaines";
40 addToCerts = true;
41 hosts = [ "capitaines.fr" ];
42 root = "/run/current-system/webapps/_www";
43 extraConfig = [ ''
44 <Directory /run/current-system/webapps/_www>
45 DirectoryIndex index.htm
46 Require all granted
47 </Directory>
48 '' ];
49 };
50 };
51}
diff --git a/nixops/modules/websites/capitaines/mastodon_static/index.html b/nixops/modules/websites/capitaines/mastodon_static/index.html
deleted file mode 100644
index fae4152..0000000
--- a/nixops/modules/websites/capitaines/mastodon_static/index.html
+++ /dev/null
@@ -1,29 +0,0 @@
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/nixops/modules/websites/capitaines/mastodon_static/oops.png b/nixops/modules/websites/capitaines/mastodon_static/oops.png
deleted file mode 100644
index 0abddad..0000000
--- a/nixops/modules/websites/capitaines/mastodon_static/oops.png
+++ /dev/null
Binary files differ