1 { lib, pkgs, config, ... }:
3 cfg = config.myServices.websites.immae.production;
4 varDir = "/var/lib/buildbot/outputs/immae/blog";
5 coursDir = "/var/lib/buildbot/outputs/immae/cours";
6 rechercheDir = "/var/lib/buildbot/outputs/immae/recherche";
7 recettesDir = "/var/lib/buildbot/outputs/immae/recettes";
8 historyDir = "/var/lib/buildbot/outputs/immae/history";
9 docsDir = "/var/lib/buildbot/outputs/immae/docs/";
10 env = config.myEnv.websites.immae;
12 options.myServices.websites.immae.production.enable = lib.mkEnableOption "enable Immae's website";
14 config = lib.mkIf cfg.enable {
15 services.webstats.sites = [ { name = "www.immae.eu"; } ];
17 services.websites.env.production.vhostConfs.immae_production = {
20 certMainHost = "www.immae.eu";
21 hosts = [ "www.immae.eu" "immae.eu" ];
25 Use Stats www.immae.eu
26 Header always set Strict-Transport-Security "max-age=31536000"
28 <LocationMatch /.well-known/(webfinger|host-meta)>
29 Header always set Referrer-Policy "strict-origin-when-cross-origin"
30 RequestHeader set X-Forwarded-Proto "https"
32 RewriteRule ^(.*)$ https://mastodon.immae.eu%{REQUEST_URI} [QSA,L]
36 RewriteCond "%{REQUEST_URI}" "!^/.well-known/(webfinger|host-meta)"
37 RewriteCond "%{HTTP_HOST}" "!^www\.immae\.eu$" [NC]
38 RewriteRule ^(.+)$ https://www.immae.eu$1 [R=302,L]
41 DirectoryIndex index.htm index.html
42 Options Indexes FollowSymLinks MultiViews Includes
47 Alias /.well-known/chatonsinfos ${./chatons}
48 <Directory ${./chatons}>
49 Options Indexes FollowSymLinks MultiViews Includes
54 Alias /.well-known/matrix ${./matrix}
55 <Directory ${./matrix}>
56 Options Indexes FollowSymLinks MultiViews Includes
59 Header always set Access-Control-Allow-Origin "*"
62 Alias /cours ${coursDir}
63 <Directory ${coursDir}>
64 DirectoryIndex index.htm index.html
65 Options Indexes FollowSymLinks MultiViews Includes
70 Alias /docs ${docsDir}
71 <Directory ${docsDir}>
72 DirectoryIndex index.htm index.html
73 Options Indexes FollowSymLinks MultiViews Includes
80 DirectoryIndex index.htm index.html
81 Options Indexes FollowSymLinks MultiViews Includes
86 Alias /recherche ${rechercheDir}
87 <Directory ${rechercheDir}>
88 DirectoryIndex index.htm index.html
89 Options Indexes FollowSymLinks MultiViews Includes
94 Alias /recettes ${recettesDir}
95 <Directory ${recettesDir}>
96 DirectoryIndex index.htm index.html
97 Options Indexes FollowSymLinks MultiViews Includes
102 Alias /history ${historyDir}
103 <Directory ${historyDir}>
104 DirectoryIndex index.html
112 services.websites.env.production.vhostConfs.immae_fr = {
115 hosts = [ "www.immae.fr" "immae.fr" ];
118 RedirectMatch 301 ^/((?!\.well-known.*$).*)$ https://www.immae.eu/chapeaux/
122 services.websites.env.production.vhostConfs.immae_bouya = {
125 hosts = [ "bouya.org" "www.bouya.org" ];
128 <Directory ${rechercheDir}>
129 DirectoryIndex index.htm index.html
130 Options Indexes FollowSymLinks MultiViews Includes