X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=modules%2Fprivate%2Fwebsites%2Fdefault.nix;h=3ac4cb548153f2af390c612d34572be381b728e4;hb=91b75ffe45f2a5d7e148c92f53a4ba90ede8df77;hp=c3d941c2f5014b3867e12e54fe806aaff6883f90;hpb=17f6eae9907a122d4472da727ae8b1ac1c40c027;p=perso%2FImmae%2FConfig%2FNix.git diff --git a/modules/private/websites/default.nix b/modules/private/websites/default.nix index c3d941c..3ac4cb5 100644 --- a/modules/private/websites/default.nix +++ b/modules/private/websites/default.nix @@ -1,4 +1,4 @@ -{ lib, pkgs, config, myconfig, ... }: +{ lib, pkgs, config, ... }: let www_root = "/run/current-system/webapps/_www"; theme_root = "/run/current-system/webapps/_theme"; @@ -56,7 +56,7 @@ let }; customLog = { extraConfig = '' - LogFormat "%v:%p %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combinedVhost + LogFormat "%{Host}i:%p %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combinedVhost ''; }; }; @@ -64,15 +64,22 @@ let makeExtraConfig = (builtins.filter (x: x != null) (lib.attrsets.mapAttrsToList (n: v: v.extraConfig or null) apacheConfig)); in { - options.myServices.websites.webappDirs = lib.mkOption { - type = lib.types.attrsOf lib.types.path; - description = '' - Webapp paths to create in /run/current-system/webapps - ''; - default = {}; + options.myServices.websites = { + enable = lib.mkEnableOption "enable websites"; + + webappDirs = lib.mkOption { + type = lib.types.attrsOf lib.types.path; + description = '' + Webapp paths to create in /run/current-system/webapps + ''; + default = {}; + }; }; - config = { + config = lib.mkIf config.myServices.websites.enable { + services.duplyBackup.profiles.php = { + rootDir = "/var/lib/php"; + }; users.users.wwwrun.extraGroups = [ "keys" ]; networking.firewall.allowedTCPPorts = [ 80 443 ]; @@ -107,7 +114,7 @@ in AuthLDAPURL ldap://ldap.immae.eu:389/dc=immae,dc=eu STARTTLS AuthLDAPBindDN cn=httpd,ou=services,dc=immae,dc=eu - AuthLDAPBindPassword "${myconfig.env.httpd.ldap.password}" + AuthLDAPBindPassword "${config.myEnv.httpd.ldap.password}" AuthType Basic AuthName "Authentification requise (Acces LDAP)" AuthBasicProvider ldap @@ -142,12 +149,12 @@ in services.filesWatcher.httpdInte.paths = [ "/var/secrets/apache-ldap" ]; services.filesWatcher.httpdTools.paths = [ "/var/secrets/apache-ldap" ]; - services.websites.production = { + services.websites.env.production = { enable = true; adminAddr = "httpd@immae.eu"; httpdName = "Prod"; ips = - let ips = myconfig.env.servers.eldiron.ips.production; + let ips = config.myEnv.servers.eldiron.ips.production; in [ips.ip4] ++ (ips.ip6 or []); modules = makeModules; extraConfig = makeExtraConfig; @@ -159,12 +166,12 @@ in }; }; - services.websites.integration = { + services.websites.env.integration = { enable = true; adminAddr = "httpd@immae.eu"; httpdName = "Inte"; ips = - let ips = myconfig.env.servers.eldiron.ips.integration; + let ips = config.myEnv.servers.eldiron.ips.integration; in [ips.ip4] ++ (ips.ip6 or []); modules = makeModules; extraConfig = makeExtraConfig; @@ -176,12 +183,12 @@ in }; }; - services.websites.tools = { + services.websites.env.tools = { enable = true; adminAddr = "httpd@immae.eu"; httpdName = "Tools"; ips = - let ips = myconfig.env.servers.eldiron.ips.main; + let ips = config.myEnv.servers.eldiron.ips.main; in [ips.ip4] ++ (ips.ip6 or []); modules = makeModules; extraConfig = makeExtraConfig ++ @@ -231,6 +238,7 @@ in denisejerome.production.enable = true; emilia.production.enable = true; + emilia.richie_production.enable = true; florian.app.enable = true; florian.integration.enable = true; @@ -248,6 +256,7 @@ in nassime.production.enable = true; naturaloutil.production.enable = true; + telioTortay.production.enable = true; papa.surveillance.enable = true; @@ -264,6 +273,7 @@ in tools.mediagoblin.enable = true; tools.peertube.enable = true; tools.tools.enable = true; + tools.email.enable = true; }; }; }