]>
Commit | Line | Data |
---|---|---|
1 | { lib, pkgs, config, ... }: | |
2 | let | |
3 | cfg = config.myServices.websites.immae.production; | |
4 | varDir = "/var/lib/buildbot/outputs/immaeEu"; | |
5 | coursDir = "/var/lib/buildbot/outputs/cours"; | |
6 | rechercheDir = "/var/lib/buildbot/outputs/recherche"; | |
7 | env = config.myEnv.websites.immae; | |
8 | in { | |
9 | options.myServices.websites.immae.production.enable = lib.mkEnableOption "enable Immae's website"; | |
10 | ||
11 | config = lib.mkIf cfg.enable { | |
12 | services.webstats.sites = [ { name = "www.immae.eu"; } ]; | |
13 | ||
14 | services.websites.env.production.vhostConfs.immae = { | |
15 | certName = "eldiron"; | |
16 | addToCerts = true; | |
17 | hosts = [ "www.immae.eu" ]; | |
18 | root = varDir; | |
19 | extraConfig = [ | |
20 | '' | |
21 | Use Stats www.immae.eu | |
22 | ||
23 | <Directory ${varDir}> | |
24 | DirectoryIndex index.htm index.html | |
25 | Options Indexes FollowSymLinks MultiViews Includes | |
26 | AllowOverride All | |
27 | Require all granted | |
28 | </Directory> | |
29 | ||
30 | Alias /cours ${coursDir} | |
31 | <Directory ${coursDir}> | |
32 | DirectoryIndex index.htm index.html | |
33 | Options Indexes FollowSymLinks MultiViews Includes | |
34 | AllowOverride All | |
35 | Require all granted | |
36 | </Directory> | |
37 | ||
38 | Alias /recherche ${rechercheDir} | |
39 | <Directory ${rechercheDir}> | |
40 | DirectoryIndex index.htm index.html | |
41 | Options Indexes FollowSymLinks MultiViews Includes | |
42 | AllowOverride All | |
43 | Require all granted | |
44 | </Directory> | |
45 | '' | |
46 | ]; | |
47 | }; | |
48 | ||
49 | services.websites.env.production.vhostConfs.immaeFr = { | |
50 | certName = "eldiron"; | |
51 | addToCerts = true; | |
52 | hosts = [ "www.immae.fr" "immae.fr" ]; | |
53 | root = null; | |
54 | extraConfig = [ '' | |
55 | RedirectMatch 301 ^/((?!\.well-known.*$).*)$ https://www.immae.eu/chapeaux/ | |
56 | '' ]; | |
57 | }; | |
58 | ||
59 | services.websites.env.production.vhostConfs.bouya = { | |
60 | certName = "eldiron"; | |
61 | addToCerts = true; | |
62 | hosts = [ "bouya.org" "www.bouya.org" ]; | |
63 | root = null; | |
64 | extraConfig = [ '' | |
65 | RedirectMatch 301 ^/((?!\.well-known.*$).*)$ https://www.normalesup.org/~bouya/ | |
66 | '' ]; | |
67 | }; | |
68 | }; | |
69 | } |