Skip to content

Commit

Permalink
Update TT-RSS, add simple test and updater flag customization (NixOS#…
Browse files Browse the repository at this point in the history
  • Loading branch information
globin authored Dec 20, 2024
2 parents d3a91c2 + 7baea17 commit 70145b7
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 7 deletions.
13 changes: 12 additions & 1 deletion nixos/modules/services/web-apps/tt-rss.nix
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,17 @@ let
'';
};

updateDaemon = {
commandFlags = mkOption {
type = types.str;
default = "--quiet";
description = ''
Command-line flags passed to the update daemon.
The default --quiet flag mutes all logging, including errors.
'';
};
};

extraConfig = mkOption {
type = types.lines;
default = "";
Expand Down Expand Up @@ -622,7 +633,7 @@ let
serviceConfig = {
User = "${cfg.user}";
Group = "tt_rss";
ExecStart = "${phpPackage}/bin/php ${cfg.root}/www/update.php --daemon --quiet";
ExecStart = "${phpPackage}/bin/php ${cfg.root}/www/update.php --daemon ${cfg.updateDaemon.commandFlags}";
Restart = "on-failure";
RestartSec = "60";
SyslogIdentifier = "tt-rss";
Expand Down
1 change: 1 addition & 0 deletions nixos/tests/all-tests.nix
Original file line number Diff line number Diff line change
Expand Up @@ -1095,6 +1095,7 @@ in {
trilium-server = handleTestOn ["x86_64-linux"] ./trilium-server.nix {};
tsm-client-gui = handleTest ./tsm-client-gui.nix {};
ttyd = handleTest ./web-servers/ttyd.nix {};
tt-rss = handleTest ./web-apps/tt-rss.nix {};
txredisapi = handleTest ./txredisapi.nix {};
tuptime = handleTest ./tuptime.nix {};
turbovnc-headless-server = handleTest ./turbovnc-headless-server.nix {};
Expand Down
22 changes: 22 additions & 0 deletions nixos/tests/web-apps/tt-rss.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import ../make-test-python.nix (
{ ... }:
{
name = "tt-rss-nixos";

nodes.machine =
{ pkgs, ... }:
{
services.tt-rss = {
enable = true;
virtualHost = "localhost";
selfUrlPath = "http://localhost/";
singleUserMode = true;
};
};

testScript = ''
machine.wait_for_unit("tt-rss.service")
machine.succeed("curl -sSfL http://localhost/ | grep 'Tiny Tiny RSS'")
'';
}
)
27 changes: 21 additions & 6 deletions pkgs/servers/tt-rss/default.nix
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
{ lib, stdenv, fetchgit }:
{
lib,
stdenv,
fetchgit,
nixosTests,
unstableGitUpdater,
}:

stdenv.mkDerivation rec {
pname = "tt-rss";
version = "unstable-2023-04-13";
version = "0-unstable-2024-11-04";

src = fetchgit {
url = "https://git.tt-rss.org/fox/tt-rss.git";
rev = "0578bf802571781a0a7e3debbbec66437a7d28b4";
hash = "sha256-j6R1QoH8SzUtyI3rGE6rHriboAfApAo/Guw8WbJ7LqU=";
rev = "42ebdb027ec249fb8e693c41d7ee80ecdc68d6ec";
hash = "sha256-QN7CwUufQSFlFde0NebO/kOYtEZCyL0ut+CNEpJMIMA=";
};

installPhase = ''
Expand All @@ -18,16 +24,25 @@ stdenv.mkDerivation rec {
# see the code of Config::get_version(). you can check that the version in
# the footer of the preferences pages is not UNKNOWN
echo "23.04" > $out/version_static.txt
echo "${version}" > $out/version_static.txt
runHook postInstall
'';

passthru = {
inherit (nixosTests) tt-rss;
updateScript = unstableGitUpdater { hardcodeZeroVersion = true; };
};

meta = with lib; {
description = "Web-based news feed (RSS/Atom) aggregator";
license = licenses.gpl2Plus;
homepage = "https://tt-rss.org";
maintainers = with maintainers; [ globin zohl ];
maintainers = with maintainers; [
gileri
globin
zohl
];
platforms = platforms.all;
};
}

0 comments on commit 70145b7

Please sign in to comment.