1 { lib, pkgs, config, mylibs, ... }:
3 cfg = config.services.myWebsites;
8 ./websites/ludivine.nix
10 ./websites/piedsjaloux.nix
11 ./websites/connexionswing.nix
14 options.services.myWebsites = {
16 enable = lib.mkEnableOption "enable websites in production";
20 enable = lib.mkEnableOption "enable websites in integration";
23 apacheConfig = lib.mkOption {
24 type = lib.types.attrsOf (lib.types.submodule {
26 modules = lib.mkOption {
27 type = lib.types.listOf (lib.types.str);
30 extraConfig = lib.mkOption {
31 type = lib.types.nullOr lib.types.lines;
37 description = "Extra global config";
43 services.myWebsites.Chloe.production.enable = cfg.production.enable;
44 services.myWebsites.Ludivine.production.enable = cfg.production.enable;
45 services.myWebsites.Aten.production.enable = cfg.production.enable;
46 services.myWebsites.PiedsJaloux.production.enable = cfg.production.enable;
47 services.myWebsites.Connexionswing.production.enable = cfg.production.enable;
49 services.myWebsites.Chloe.integration.enable = cfg.integration.enable;
50 services.myWebsites.Ludivine.integration.enable = cfg.integration.enable;
51 services.myWebsites.Aten.integration.enable = cfg.integration.enable;
52 services.myWebsites.PiedsJaloux.integration.enable = cfg.integration.enable;
53 services.myWebsites.Connexionswing.integration.enable = cfg.integration.enable;
55 services.myWebsites.apacheConfig = {
57 modules = [ "deflate" "filter" ];
59 AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript
63 modules = [ "macro" ];
66 modules = [ "ldap" "authnz_ldap" ];
68 extraConfig = assert mylibs.checkEnv "NIXOPS_HTTP_LDAP_PASSWORD"; ''
69 <IfModule ldap_module>
70 LDAPSharedCacheSize 500000
73 LDAPOpCacheEntries 1024
78 <IfModule authnz_ldap_module>
79 AuthLDAPURL ldap://ldap.immae.eu:389/dc=immae,dc=eu STARTTLS
80 AuthLDAPBindDN cn=httpd,ou=services,dc=immae,dc=eu
81 AuthLDAPBindPassword "${builtins.getEnv "NIXOPS_HTTP_LDAP_PASSWORD"}"
83 AuthName "Authentification requise (Acces LDAP)"
84 AuthBasicProvider ldap
88 <Macro Stats %{domain}>
89 Alias /awstats /var/lib/goaccess/%{domain}
90 <Directory /var/lib/goaccess/%{domain}>
91 DirectoryIndex index.html
97 Require ldap-group cn=%{domain},ou=stats,cn=httpd,ou=services,dc=immae,dc=eu
103 modules = [ "http2" ];
105 Protocols h2 http/1.1
110 LogFormat "%v:%p %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combinedVhost