diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2019-01-29 23:59:49 +0100 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2019-01-29 23:59:49 +0100 |
commit | 10bd8c08a3bbd9e0e5f5b25ffb278b8385083bd0 (patch) | |
tree | 7379735f1f073e6a8177ad855bb7bc59cc92657a /nixops/modules/websites/capitaines/default.nix | |
parent | 9a35b8f94cc55ee429b36be1a5e7eb1f52934a34 (diff) | |
download | Nix-10bd8c08a3bbd9e0e5f5b25ffb278b8385083bd0.tar.gz Nix-10bd8c08a3bbd9e0e5f5b25ffb278b8385083bd0.tar.zst Nix-10bd8c08a3bbd9e0e5f5b25ffb278b8385083bd0.zip |
Add capitaines mastodon pages
Diffstat (limited to 'nixops/modules/websites/capitaines/default.nix')
-rw-r--r-- | nixops/modules/websites/capitaines/default.nix | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/nixops/modules/websites/capitaines/default.nix b/nixops/modules/websites/capitaines/default.nix new file mode 100644 index 0000000..7f8f4c6 --- /dev/null +++ b/nixops/modules/websites/capitaines/default.nix | |||
@@ -0,0 +1,34 @@ | |||
1 | { lib, pkgs, config, myconfig, mylibs, ... }: | ||
2 | let | ||
3 | cfg = config.services.myWebsites.Capitaines; | ||
4 | env = myconfig.env.websites.capitaines; | ||
5 | siteDir = ./mastodon_static; | ||
6 | in { | ||
7 | options.services.myWebsites.Capitaines = { | ||
8 | production = { | ||
9 | enable = lib.mkEnableOption "enable Capitaines's website"; | ||
10 | }; | ||
11 | }; | ||
12 | |||
13 | config = lib.mkIf cfg.production.enable { | ||
14 | security.acme.certs."capitaines_mastodon" = config.services.myCertificates.certConfig // { | ||
15 | domain = "mastodon.capitaines.fr"; | ||
16 | }; | ||
17 | |||
18 | services.myWebsites.production.vhostConfs.capitaines = { | ||
19 | certName = "capitaines_mastodon"; | ||
20 | hosts = [ "mastodon.capitaines.fr" ]; | ||
21 | root = siteDir; | ||
22 | extraConfig = [ | ||
23 | '' | ||
24 | ErrorDocument 404 /index.html | ||
25 | <Directory ${siteDir}> | ||
26 | DirectoryIndex index.html | ||
27 | Options Indexes FollowSymLinks MultiViews Includes | ||
28 | Require all granted | ||
29 | </Directory> | ||
30 | '' | ||
31 | ]; | ||
32 | }; | ||
33 | }; | ||
34 | } | ||