aboutsummaryrefslogtreecommitdiff
path: root/modules/private/websites/default.nix
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2020-04-18 16:10:56 +0200
committerIsmaël Bouya <ismael.bouya@normalesup.org>2020-04-20 01:51:48 +0200
commitd3452fc59b9839846225fd254926c64a9c71f071 (patch)
treea98a0958b826ac4b2ab137720edf0195c65dd958 /modules/private/websites/default.nix
parent514f9ec3beec470c4445be690673a0ceab9115b4 (diff)
downloadNix-d3452fc59b9839846225fd254926c64a9c71f071.tar.gz
Nix-d3452fc59b9839846225fd254926c64a9c71f071.tar.zst
Nix-d3452fc59b9839846225fd254926c64a9c71f071.zip
Refactor websites
Diffstat (limited to 'modules/private/websites/default.nix')
-rw-r--r--modules/private/websites/default.nix112
1 files changed, 65 insertions, 47 deletions
diff --git a/modules/private/websites/default.nix b/modules/private/websites/default.nix
index 3d43b11..5c33e1c 100644
--- a/modules/private/websites/default.nix
+++ b/modules/private/websites/default.nix
@@ -43,7 +43,21 @@ let
43 ''; 43 '';
44 }; 44 };
45 global = { 45 global = {
46 extraConfig = (pkgs.webapps.apache-default.override { inherit www_root;}).apacheConfig; 46 extraConfig = ''
47 ErrorDocument 500 /maintenance_immae.html
48 ErrorDocument 501 /maintenance_immae.html
49 ErrorDocument 502 /maintenance_immae.html
50 ErrorDocument 503 /maintenance_immae.html
51 ErrorDocument 504 /maintenance_immae.html
52 Alias /maintenance_immae.html ${www_root}/maintenance_immae.html
53 ProxyPass /maintenance_immae.html !
54
55 AliasMatch "(.*)/googleb6d69446ff4ca3e5.html" ${www_root}/googleb6d69446ff4ca3e5.html
56 <Directory ${www_root}>
57 AllowOverride None
58 Require all granted
59 </Directory>
60 '';
47 }; 61 };
48 apaxy = { 62 apaxy = {
49 extraConfig = (pkgs.webapps.apache-theme.override { inherit theme_root; }).apacheConfig; 63 extraConfig = (pkgs.webapps.apache-theme.override { inherit theme_root; }).apacheConfig;
@@ -64,17 +78,7 @@ let
64 makeExtraConfig = (builtins.filter (x: x != null) (lib.attrsets.mapAttrsToList (n: v: v.extraConfig or null) apacheConfig)); 78 makeExtraConfig = (builtins.filter (x: x != null) (lib.attrsets.mapAttrsToList (n: v: v.extraConfig or null) apacheConfig));
65in 79in
66{ 80{
67 options.myServices.websites = { 81 options.myServices.websites.enable = lib.mkEnableOption "enable websites";
68 enable = lib.mkEnableOption "enable websites";
69
70 webappDirs = lib.mkOption {
71 type = lib.types.attrsOf lib.types.path;
72 description = ''
73 Webapp paths to create in /run/current-system/webapps
74 '';
75 default = {};
76 };
77 };
78 82
79 config = lib.mkIf config.myServices.websites.enable { 83 config = lib.mkIf config.myServices.websites.enable {
80 services.duplyBackup.profiles.php = { 84 services.duplyBackup.profiles.php = {
@@ -213,61 +217,75 @@ in
213 }; 217 };
214 }; 218 };
215 219
216 system.extraSystemBuilderCmds = lib.mkIf (builtins.length (builtins.attrValues config.myServices.websites.webappDirs) > 0) '' 220 services.websites.webappDirs = {
217 mkdir -p $out/webapps 221 _www = ./_www;
218 ${builtins.concatStringsSep "\n" (lib.attrsets.mapAttrsToList (name: path: "ln -s ${path} $out/webapps/${name}") config.myServices.websites.webappDirs)} 222 _theme = pkgs.webapps.apache-theme.theme;
219 ''; 223 };
220
221 myServices.websites = { 224 myServices.websites = {
222 webappDirs = { 225 capitaines.landing_pages.enable = true;
223 _www = pkgs.webapps.apache-default.www;
224 _theme = pkgs.webapps.apache-theme.theme;
225 };
226 226
227 isabelle.aten_integration.enable = true; 227 chloe = {
228 isabelle.aten_production.enable = true; 228 integration.enable = true;
229 isabelle.iridologie.enable = true; 229 production.enable = true;
230 };
230 231
231 capitaines.production.enable = true; 232 connexionswing = {
233 integration.enable = true;
234 production.enable = true;
235 };
232 236
233 chloe.integration.enable = true; 237 denise = {
234 chloe.production.enable = true; 238 evariste.enable = true;
239 denisejerome.enable = true;
240 };
235 241
236 connexionswing.integration.enable = true; 242 emilia.moodle.enable = true;
237 connexionswing.production.enable = true;
238 243
239 denisejerome.production.enable = true; 244 florian = {
245 app.enable = true;
246 integration.enable = true;
247 production.enable = true;
248 };
240 249
241 emilia.production.enable = true; 250 immae = {
242 emilia.richie_production.enable = true; 251 production.enable = true;
252 release.enable = true;
253 temp.enable = true;
254 };
243 255
244 florian.app.enable = true; 256 isabelle = {
245 florian.integration.enable = true; 257 aten_integration.enable = true;
246 florian.production.enable = true; 258 aten_production.enable = true;
259 iridologie.enable = true;
260 };
247 261
248 immae.production.enable = true; 262 jerome.naturaloutil.enable = true;
249 immae.release.enable = true;
250 immae.temp.enable = true;
251 263
252 leila.production.enable = true; 264 leila.production.enable = true;
253 265
254 ludivinecassal.integration.enable = true; 266 ludivine = {
255 ludivinecassal.production.enable = true; 267 integration.enable = true;
268 production.enable = true;
269 };
256 270
257 nassime.production.enable = true; 271 nassime.production.enable = true;
258 272
259 evariste.production.enable = true; 273 papa = {
260 naturaloutil.production.enable = true; 274 surveillance.enable = true;
261 telioTortay.production.enable = true; 275 maison_bbc.enable = true;
276 };
262 277
263 papa.surveillance.enable = true; 278 piedsjaloux = {
264 papa.maison_bbc.enable = true; 279 integration.enable = true;
280 production.enable = true;
281 };
265 282
266 piedsjaloux.integration.enable = true; 283 richie.production.enable = true;
267 piedsjaloux.production.enable = true;
268 284
269 syden.peertube.enable = true; 285 syden.peertube.enable = true;
270 286
287 telio_tortay.production.enable = true;
288
271 tools.cloud.enable = true; 289 tools.cloud.enable = true;
272 tools.dav.enable = true; 290 tools.dav.enable = true;
273 tools.db.enable = true; 291 tools.db.enable = true;