server: minor performance tuning
This commit is contained in:
parent
8f19644b3e
commit
cc4ae20674
|
@ -62,9 +62,24 @@ in {
|
|||
DISABLE_REGISTRATION = true;
|
||||
REGISTER_EMAIL_CONFIRM = true;
|
||||
};
|
||||
cache = {
|
||||
ADAPTER = "redis";
|
||||
HOST = "redis+socket://${config.services.redis.servers.forgejo.unixSocket}";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
systemd.services.forgejo = {
|
||||
wants = [ "redis-forgejo.service" ];
|
||||
after = [ "redis-forgejo.service" ];
|
||||
};
|
||||
|
||||
users.users.forgejo.extraGroups = [ config.services.redis.servers.forgejo.user ];
|
||||
|
||||
services.redis.servers.forgejo = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
services.nginx.virtualHosts."cloud.${cfg.domainName}" = {
|
||||
quic = true;
|
||||
enableACME = true;
|
||||
|
@ -82,6 +97,7 @@ in {
|
|||
dbtype = "pgsql";
|
||||
dbhost = "/run/postgresql";
|
||||
};
|
||||
phpOptions."opcache.interned_strings_buffer" = "16";
|
||||
settings.overwriteprotocol = "https";
|
||||
hostName = "cloud.${cfg.domainName}";
|
||||
https = true;
|
||||
|
|
|
@ -27,6 +27,11 @@ in {
|
|||
hostName = "mail.${cfg.domainName}";
|
||||
maxAttachmentSize = 100;
|
||||
plugins = [ "persistent_login" ];
|
||||
extraConfig = ''
|
||||
$config['smtp_server'] = "tls://${config.mailserver.fqdn}";
|
||||
$config['smtp_user'] = "%u";
|
||||
$config['smtp_pass'] = "%p";
|
||||
'';
|
||||
};
|
||||
mailserver = {
|
||||
enable = true;
|
||||
|
|
|
@ -71,6 +71,8 @@ in {
|
|||
};
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [ matrix-synapse-tools.rust-synapse-compress-state ];
|
||||
|
||||
services.matrix-synapse = {
|
||||
enable = true;
|
||||
extraConfigFiles = [ "/var/lib/matrix-synapse/config.yaml" ];
|
||||
|
|
|
@ -133,9 +133,12 @@ in {
|
|||
{ directory = /var/lib/${config.services.prometheus.stateDir}; user = "prometheus"; group = "prometheus"; mode = "0755"; }
|
||||
] ++ lib.optionals (config.services.qbittorrent-nox.enable or false) [
|
||||
{ directory = /var/lib/qbittorrent-nox; mode = "0755"; }
|
||||
] ++ lib.optionals (config.services.redis.servers.rspamd.enable or false) [
|
||||
{ directory = /var/lib/redis-rspamd; user = "redis-rspamd"; group = "redis-rspamd"; mode = "0700"; }
|
||||
] ++ lib.optionals config.services.roundcube.enable [
|
||||
] ++ (lib.mapAttrsToList
|
||||
(k: v: let
|
||||
name = if k == "" then "redis" else "redis-${k}";
|
||||
in { directory = /var/lib/${name}; inherit (v) user; group = v.user; mode = "0700"; })
|
||||
(lib.filterAttrs (k: v: v.enable or false) config.services.redis.servers))
|
||||
++ lib.optionals config.services.roundcube.enable [
|
||||
{ directory = /var/lib/roundcube; user = "roundcube"; group = "roundcube"; mode = "0700"; }
|
||||
] ++ lib.optionals config.services.rspamd.enable [
|
||||
{ directory = /var/lib/rspamd; user = "rspamd"; group = "rspamd"; mode = "0700"; }
|
||||
|
|
Loading…
Reference in a new issue