]>
Commit | Line | Data |
---|---|---|
10bd8c08 IB |
1 | { lib, pkgs, config, myconfig, mylibs, ... }: |
2 | let | |
3 | cfg = config.services.myWebsites.Capitaines; | |
4 | env = myconfig.env.websites.capitaines; | |
7da3ceec IB |
5 | webappName = "capitaines_mastodon"; |
6 | root = "/run/current-system/webapps/${webappName}"; | |
10bd8c08 IB |
7 | siteDir = ./mastodon_static; |
8 | in { | |
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 { | |
eb190677 | 16 | security.acme.certs."capitaines" = config.services.myCertificates.certConfig // { |
10bd8c08 | 17 | domain = "mastodon.capitaines.fr"; |
eb190677 | 18 | extraDomains = { "capitaines.fr" = null; }; |
10bd8c08 | 19 | }; |
7da3ceec IB |
20 | system.extraSystemBuilderCmds = '' |
21 | mkdir -p $out/webapps | |
22 | ln -s ${siteDir} $out/webapps/${webappName} | |
23 | ''; | |
10bd8c08 | 24 | |
eb190677 IB |
25 | services.myWebsites.production.vhostConfs.capitaines_mastodon = { |
26 | certName = "capitaines"; | |
10bd8c08 | 27 | hosts = [ "mastodon.capitaines.fr" ]; |
7da3ceec | 28 | root = root; |
10bd8c08 IB |
29 | extraConfig = [ |
30 | '' | |
31 | ErrorDocument 404 /index.html | |
7da3ceec | 32 | <Directory ${root}> |
10bd8c08 IB |
33 | DirectoryIndex index.html |
34 | Options Indexes FollowSymLinks MultiViews Includes | |
35 | Require all granted | |
36 | </Directory> | |
37 | '' | |
38 | ]; | |
39 | }; | |
eb190677 IB |
40 | |
41 | services.myWebsites.production.vhostConfs.capitaines = { | |
42 | certName = "capitaines"; | |
43 | hosts = [ "capitaines.fr" ]; | |
44 | root = "/run/current-system/webapps/_www"; | |
45 | extraConfig = [ '' | |
46 | <Directory /run/current-system/webapps/_www> | |
47 | DirectoryIndex index.htm | |
48 | Require all granted | |
49 | </Directory> | |
50 | '' ]; | |
51 | }; | |
10bd8c08 IB |
52 | }; |
53 | } |