diff options
author | ajs124 <git@ajs124.de> | 2023-12-27 17:03:51 +0100 |
---|---|---|
committer | ajs124 <git@ajs124.de> | 2024-02-07 17:41:27 +0100 |
commit | 106626b8d7fb3708e72d566d843fa78f0a294022 (patch) | |
tree | 6431bf5498d5a18c45ec6137eee37f930f3e45da | |
parent | 33ca948d6a8038cd64c72735b82f8c944982e52c (diff) | |
download | nixlib-106626b8d7fb3708e72d566d843fa78f0a294022.tar nixlib-106626b8d7fb3708e72d566d843fa78f0a294022.tar.gz nixlib-106626b8d7fb3708e72d566d843fa78f0a294022.tar.bz2 nixlib-106626b8d7fb3708e72d566d843fa78f0a294022.tar.lz nixlib-106626b8d7fb3708e72d566d843fa78f0a294022.tar.xz nixlib-106626b8d7fb3708e72d566d843fa78f0a294022.tar.zst nixlib-106626b8d7fb3708e72d566d843fa78f0a294022.zip |
nixos/tt-rss: add phpPackage option
right now, we have php81 and php (which points to php82), which means that: - php-fpm uses php81 - the update preStart uses php81 - the actual updater uses php82
-rw-r--r-- | nixos/modules/services/web-apps/tt-rss.nix | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/nixos/modules/services/web-apps/tt-rss.nix b/nixos/modules/services/web-apps/tt-rss.nix index 6c9b4bd1b8a7..84342165c9c0 100644 --- a/nixos/modules/services/web-apps/tt-rss.nix +++ b/nixos/modules/services/web-apps/tt-rss.nix @@ -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"; |