From d44f759b5588e5c9350958329409c7ab598740e5 Mon Sep 17 00:00:00 2001 From: Izorkin Date: Sat, 15 Jun 2019 18:40:11 +0300 Subject: [PATCH] nixos/restya-board: fix work with phpfpm-rootless mode --- .../modules/services/web-apps/restya-board.nix | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/nixos/modules/services/web-apps/restya-board.nix b/nixos/modules/services/web-apps/restya-board.nix index 2e5e0ea6622d..d4c99d6c44bf 100644 --- a/nixos/modules/services/web-apps/restya-board.nix +++ b/nixos/modules/services/web-apps/restya-board.nix @@ -13,7 +13,7 @@ let runDir = "/run/restya-board"; poolName = "restya-board"; - phpfpmSocketName = "/run/phpfpm/${poolName}.sock"; + phpfpmSocketName = "/run/phpfpm-${poolName}/${poolName}.sock"; in @@ -178,9 +178,12 @@ in config = mkIf cfg.enable { - services.phpfpm.poolConfigs = { + services.phpfpm.pools = { "${poolName}" = { - listen = phpfpmSocketName; + socketName = "${poolName}"; + phpPackage = pkgs.php; + user = "${cfg.user}"; + group = "${cfg.group}"; phpOptions = '' date.timezone = "CET" @@ -192,11 +195,9 @@ in ''} ''; extraConfig = '' - listen.owner = nginx - listen.group = nginx + listen.owner = ${config.services.nginx.user} + listen.group = ${config.services.nginx.group} listen.mode = 0600 - user = ${cfg.user} - group = ${cfg.group} pm = dynamic pm.max_children = 75 pm.start_servers = 10 @@ -365,6 +366,9 @@ in home = runDir; group = "restya-board"; }; + users.users.nginx = { + extraGroups = [ "restya-board" ]; + }; users.groups.restya-board = {}; services.postgresql.enable = mkIf (cfg.database.host == null) true;