nixos/{kanboard, roundcube, baikal, grocy, icingaweb2, selfoss, tt-rss}: don't hard-code nginx user in service (#510765)
This commit is contained in:
@@ -256,8 +256,8 @@ in
|
||||
upload_max_filesize = ${cfg.maxAttachmentSize}
|
||||
'';
|
||||
settings = lib.mapAttrs (name: lib.mkDefault) {
|
||||
"listen.owner" = "nginx";
|
||||
"listen.group" = "nginx";
|
||||
"listen.owner" = config.services.nginx.user;
|
||||
"listen.group" = config.services.nginx.group;
|
||||
"listen.mode" = "0660";
|
||||
"pm" = "dynamic";
|
||||
"pm.max_children" = 75;
|
||||
|
||||
@@ -57,8 +57,8 @@ in
|
||||
"BAIKAL_PATH_SPECIFIC" = "/var/lib/baikal/specific/";
|
||||
};
|
||||
settings = lib.mapAttrs (name: lib.mkDefault) {
|
||||
"listen.owner" = "nginx";
|
||||
"listen.group" = "nginx";
|
||||
"listen.owner" = config.services.nginx.user;
|
||||
"listen.group" = config.services.nginx.group;
|
||||
"listen.mode" = "0600";
|
||||
"pm" = "dynamic";
|
||||
"pm.max_children" = 75;
|
||||
|
||||
@@ -44,7 +44,7 @@ in
|
||||
"pm" = "dynamic";
|
||||
"php_admin_value[error_log]" = "stderr";
|
||||
"php_admin_flag[log_errors]" = true;
|
||||
"listen.owner" = "nginx";
|
||||
"listen.owner" = config.services.nginx.user;
|
||||
"catch_workers_output" = true;
|
||||
"pm.max_children" = "32";
|
||||
"pm.start_servers" = "2";
|
||||
@@ -52,6 +52,20 @@ in
|
||||
"pm.max_spare_servers" = "4";
|
||||
"pm.max_requests" = "500";
|
||||
};
|
||||
defaultText = lib.literalExpression ''
|
||||
{
|
||||
"pm" = "dynamic";
|
||||
"php_admin_value[error_log]" = "stderr";
|
||||
"php_admin_flag[log_errors]" = true;
|
||||
"listen.owner" = config.services.nginx.user;
|
||||
"catch_workers_output" = true;
|
||||
"pm.max_children" = "32";
|
||||
"pm.start_servers" = "2";
|
||||
"pm.min_spare_servers" = "2";
|
||||
"pm.max_spare_servers" = "4";
|
||||
"pm.max_requests" = "500";
|
||||
}
|
||||
'';
|
||||
|
||||
description = ''
|
||||
Options for grocy's PHPFPM pool.
|
||||
|
||||
@@ -200,8 +200,8 @@ in
|
||||
date.timezone = "${cfg.timezone}"
|
||||
'';
|
||||
settings = mapAttrs (name: mkDefault) {
|
||||
"listen.owner" = "nginx";
|
||||
"listen.group" = "nginx";
|
||||
"listen.owner" = config.services.nginx.user;
|
||||
"listen.group" = config.services.nginx.group;
|
||||
"listen.mode" = "0600";
|
||||
"pm" = "dynamic";
|
||||
"pm.max_children" = 75;
|
||||
|
||||
@@ -123,7 +123,7 @@ in
|
||||
"pm" = "dynamic";
|
||||
"php_admin_value[error_log]" = "stderr";
|
||||
"php_admin_flag[log_errors]" = true;
|
||||
"listen.owner" = "nginx";
|
||||
"listen.owner" = config.services.nginx.user;
|
||||
"catch_workers_output" = true;
|
||||
"pm.max_children" = "32";
|
||||
"pm.start_servers" = "2";
|
||||
|
||||
@@ -37,7 +37,8 @@ in
|
||||
|
||||
user = mkOption {
|
||||
type = types.str;
|
||||
default = "nginx";
|
||||
default = config.services.nginx.user;
|
||||
defaultText = lib.literalExpression "config.services.nginx.user";
|
||||
description = ''
|
||||
User account under which both the service and the web-application run.
|
||||
'';
|
||||
@@ -122,10 +123,10 @@ in
|
||||
config = mkIf cfg.enable {
|
||||
services.phpfpm.pools = mkIf (cfg.pool == "${poolName}") {
|
||||
${poolName} = {
|
||||
user = "nginx";
|
||||
user = config.services.nginx.user;
|
||||
settings = mapAttrs (name: mkDefault) {
|
||||
"listen.owner" = "nginx";
|
||||
"listen.group" = "nginx";
|
||||
"listen.owner" = config.services.nginx.user;
|
||||
"listen.group" = config.services.nginx.group;
|
||||
"listen.mode" = "0600";
|
||||
"pm" = "dynamic";
|
||||
"pm.max_children" = 75;
|
||||
|
||||
@@ -594,8 +594,8 @@ in
|
||||
inherit (cfg) user;
|
||||
inherit phpPackage;
|
||||
settings = mapAttrs (name: mkDefault) {
|
||||
"listen.owner" = "nginx";
|
||||
"listen.group" = "nginx";
|
||||
"listen.owner" = config.services.nginx.user;
|
||||
"listen.group" = config.services.nginx.group;
|
||||
"listen.mode" = "0600";
|
||||
"pm" = "dynamic";
|
||||
"pm.max_children" = 75;
|
||||
|
||||
Reference in New Issue
Block a user