Merge pull request #277137 from ajs124/fix/tt-rss-phpPackage
nixos/tt-rss: add phpPackage option
This commit is contained in:
@@ -4,6 +4,8 @@ with lib;
|
||||
let
|
||||
cfg = config.services.tt-rss;
|
||||
|
||||
inherit (cfg) phpPackage;
|
||||
|
||||
configVersion = 26;
|
||||
|
||||
dbPort = if cfg.database.port == null
|
||||
@@ -26,7 +28,7 @@ let
|
||||
;
|
||||
in pkgs.writeText "config.php" ''
|
||||
<?php
|
||||
putenv('TTRSS_PHP_EXECUTABLE=${pkgs.php}/bin/php');
|
||||
putenv('TTRSS_PHP_EXECUTABLE=${phpPackage}/bin/php');
|
||||
|
||||
putenv('TTRSS_LOCK_DIRECTORY=${cfg.root}/lock');
|
||||
putenv('TTRSS_CACHE_DIR=${cfg.root}/cache');
|
||||
@@ -456,6 +458,15 @@ let
|
||||
'';
|
||||
};
|
||||
|
||||
phpPackage = lib.mkOption {
|
||||
type = lib.types.package;
|
||||
default = pkgs.php;
|
||||
defaultText = "pkgs.php";
|
||||
description = lib.mdDoc ''
|
||||
php package to use for php fpm and update daemon.
|
||||
'';
|
||||
};
|
||||
|
||||
plugins = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = ["auth_internal" "note"];
|
||||
@@ -543,7 +554,7 @@ let
|
||||
services.phpfpm.pools = mkIf (cfg.pool == "${poolName}") {
|
||||
${poolName} = {
|
||||
inherit (cfg) user;
|
||||
phpPackage = pkgs.php81;
|
||||
inherit phpPackage;
|
||||
settings = mapAttrs (name: mkDefault) {
|
||||
"listen.owner" = "nginx";
|
||||
"listen.group" = "nginx";
|
||||
@@ -605,13 +616,13 @@ let
|
||||
description = "Tiny Tiny RSS feeds update daemon";
|
||||
|
||||
preStart = ''
|
||||
${pkgs.php81}/bin/php ${cfg.root}/www/update.php --update-schema --force-yes
|
||||
${phpPackage}/bin/php ${cfg.root}/www/update.php --update-schema --force-yes
|
||||
'';
|
||||
|
||||
serviceConfig = {
|
||||
User = "${cfg.user}";
|
||||
Group = "tt_rss";
|
||||
ExecStart = "${pkgs.php}/bin/php ${cfg.root}/www/update.php --daemon --quiet";
|
||||
ExecStart = "${phpPackage}/bin/php ${cfg.root}/www/update.php --daemon --quiet";
|
||||
Restart = "on-failure";
|
||||
RestartSec = "60";
|
||||
SyslogIdentifier = "tt-rss";
|
||||
|
||||
Reference in New Issue
Block a user