]>
Commit | Line | Data |
---|---|---|
ab8f306d | 1 | { lib, pkgs, config, ... }: |
10bd8c08 | 2 | let |
edba35fe IB |
3 | cfg = config.myServices.websites.capitaines.production; |
4 | env = config.myEnv.websites.capitaines; | |
10bd8c08 | 5 | in { |
f8026b6e | 6 | options.myServices.websites.capitaines.production.enable = lib.mkEnableOption "enable Capitaines's website"; |
10bd8c08 | 7 | |
f8026b6e | 8 | config = lib.mkIf cfg.enable { |
edba35fe IB |
9 | myServices.websites.webappDirs.capitaines_mastodon = ./mastodon_static; |
10 | services.websites.env.production.vhostConfs.capitaines_mastodon = let | |
11 | root = "/run/current-system/webapps/capitaines_mastodon"; | |
12 | in { | |
7df420c2 IB |
13 | certName = "capitaines"; |
14 | certMainHost = "mastodon.capitaines.fr"; | |
15 | hosts = [ "mastodon.capitaines.fr" ]; | |
16 | root = root; | |
17 | extraConfig = [ | |
10bd8c08 IB |
18 | '' |
19 | ErrorDocument 404 /index.html | |
7da3ceec | 20 | <Directory ${root}> |
10bd8c08 IB |
21 | DirectoryIndex index.html |
22 | Options Indexes FollowSymLinks MultiViews Includes | |
23 | Require all granted | |
24 | </Directory> | |
25 | '' | |
26 | ]; | |
27 | }; | |
eb190677 | 28 | |
edba35fe IB |
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 | ||
29f8cb85 | 49 | services.websites.env.production.vhostConfs.capitaines = { |
7df420c2 IB |
50 | certName = "capitaines"; |
51 | addToCerts = true; | |
52 | hosts = [ "capitaines.fr" ]; | |
53 | root = "/run/current-system/webapps/_www"; | |
eb190677 IB |
54 | extraConfig = [ '' |
55 | <Directory /run/current-system/webapps/_www> | |
56 | DirectoryIndex index.htm | |
57 | Require all granted | |
58 | </Directory> | |
59 | '' ]; | |
60 | }; | |
10bd8c08 IB |
61 | }; |
62 | } |