···572572 </listitem>
573573 <listitem>
574574 <para>
575575+ <literal>tt-rss</literal> was upgraded to the commit on
576576+ 2021-06-21, which has breaking changes. If you use
577577+ <literal>services.tt-rss.extraConfig</literal> you should
578578+ migrate to the <literal>putenv</literal>-style configuration.
579579+ See
580580+ <link xlink:href="https://community.tt-rss.org/t/rip-config-php-hello-classes-config-php/4337">this
581581+ Discourse post</link> in the tt-rss forums for more details.
582582+ </para>
583583+ </listitem>
584584+ <listitem>
585585+ <para>
575586 The following Visual Studio Code extensions were renamed to
576587 keep the naming convention uniform.
577588 </para>
+2
nixos/doc/manual/release-notes/rl-2111.section.md
···146146147147- the `mingw-64` package has been upgraded from 6.0.0 to 9.0.0
148148149149+- `tt-rss` was upgraded to the commit on 2021-06-21, which has breaking changes. If you use `services.tt-rss.extraConfig` you should migrate to the `putenv`-style configuration. See [this Discourse post](https://community.tt-rss.org/t/rip-config-php-hello-classes-config-php/4337) in the tt-rss forums for more details.
150150+149151- The following Visual Studio Code extensions were renamed to keep the naming convention uniform.
150152 - `bbenoist.Nix` -> `bbenoist.nix`
151153 - `CoenraadS.bracket-pair-colorizer` -> `coenraads.bracket-pair-colorizer`
+68-59
nixos/modules/services/web-apps/tt-rss.nix
···1919 mysqlLocal = cfg.database.createLocally && cfg.database.type == "mysql";
2020 pgsqlLocal = cfg.database.createLocally && cfg.database.type == "pgsql";
21212222- tt-rss-config = pkgs.writeText "config.php" ''
2222+ tt-rss-config = let
2323+ password =
2424+ if (cfg.database.password != null) then
2525+ "${(escape ["'" "\\"] cfg.database.password)}"
2626+ else if (cfg.database.passwordFile != null) then
2727+ "file_get_contents('${cfg.database.passwordFile}'"
2828+ else
2929+ ""
3030+ ;
3131+ in pkgs.writeText "config.php" ''
2332 <?php
3333+ putenv('TTRSS_PHP_EXECUTABLE=${pkgs.php}/bin/php');
24342525- define('PHP_EXECUTABLE', '${pkgs.php}/bin/php');
2626-2727- define('LOCK_DIRECTORY', '${lockDir}');
2828- define('CACHE_DIR', '${cacheDir}');
2929- define('ICONS_DIR', '${feedIconsDir}');
3030- define('ICONS_URL', '${feedIconsDir}');
3131- define('SELF_URL_PATH', '${cfg.selfUrlPath}');
3535+ putenv('TTRSS_LOCK_DIRECTORY=${lockDir}');
3636+ putenv('TTRSS_CACHE_DIR=${cacheDir}');
3737+ putenv('TTRSS_ICONS_DIR=${feedIconsDir}');
3838+ putenv('TTRSS_ICONS_URL=${feedIconsDir}');
3939+ putenv('TTRSS_SELF_URL_PATH=${cfg.selfUrlPath}');
32403333- define('MYSQL_CHARSET', 'UTF8');
4141+ putenv('TTRSS_MYSQL_CHARSET=UTF8');
34423535- define('DB_TYPE', '${cfg.database.type}');
3636- define('DB_HOST', '${optionalString (cfg.database.host != null) cfg.database.host}');
3737- define('DB_USER', '${cfg.database.user}');
3838- define('DB_NAME', '${cfg.database.name}');
3939- define('DB_PASS', ${
4040- if (cfg.database.password != null) then
4141- "'${(escape ["'" "\\"] cfg.database.password)}'"
4242- else if (cfg.database.passwordFile != null) then
4343- "file_get_contents('${cfg.database.passwordFile}')"
4444- else
4545- "''"
4646- });
4747- define('DB_PORT', '${toString dbPort}');
4343+ putenv('TTRSS_DB_TYPE=${cfg.database.type}');
4444+ putenv('TTRSS_DB_HOST=${optionalString (cfg.database.host != null) cfg.database.host}');
4545+ putenv('TTRSS_DB_USER=${cfg.database.user}');
4646+ putenv('TTRSS_DB_NAME=${cfg.database.name}');
4747+ putenv('TTRSS_DB_PASS=${password}');
4848+ putenv('TTRSS_DB_PORT=${toString dbPort}');
48494949- define('AUTH_AUTO_CREATE', ${boolToString cfg.auth.autoCreate});
5050- define('AUTH_AUTO_LOGIN', ${boolToString cfg.auth.autoLogin});
5050+ putenv('TTRSS_AUTH_AUTO_CREATE=${boolToString cfg.auth.autoCreate}');
5151+ putenv('TTRSS_AUTH_AUTO_LOGIN=${boolToString cfg.auth.autoLogin}');
51525252- define('FEED_CRYPT_KEY', '${escape ["'" "\\"] cfg.feedCryptKey}');
5353+ putenv('TTRSS_FEED_CRYPT_KEY=${escape ["'" "\\"] cfg.feedCryptKey}');
535454555555- define('SINGLE_USER_MODE', ${boolToString cfg.singleUserMode});
5656+ putenv('TTRSS_SINGLE_USER_MODE=${boolToString cfg.singleUserMode}');
56575757- define('SIMPLE_UPDATE_MODE', ${boolToString cfg.simpleUpdateMode});
5858+ putenv('TTRSS_SIMPLE_UPDATE_MODE=${boolToString cfg.simpleUpdateMode}');
58595959- // Never check for updates - the running version of the code should be
6060- // controlled entirely by the version of TT-RSS active in the current Nix
6161- // profile. If TT-RSS updates itself to a version requiring a database
6262- // schema upgrade, and then the SystemD tt-rss.service is restarted, the
6363- // old code copied from the Nix store will overwrite the updated version,
6464- // causing the code to detect the need for a schema "upgrade" (since the
6565- // schema version in the database is different than in the code), but the
6666- // update schema operation in TT-RSS will do nothing because the schema
6767- // version in the database is newer than that in the code.
6868- define('CHECK_FOR_UPDATES', false);
6060+ # Never check for updates - the running version of the code should
6161+ # be controlled entirely by the version of TT-RSS active in the
6262+ # current Nix profile. If TT-RSS updates itself to a version
6363+ # requiring a database schema upgrade, and then the SystemD
6464+ # tt-rss.service is restarted, the old code copied from the Nix
6565+ # store will overwrite the updated version, causing the code to
6666+ # detect the need for a schema "upgrade" (since the schema version
6767+ # in the database is different than in the code), but the update
6868+ # schema operation in TT-RSS will do nothing because the schema
6969+ # version in the database is newer than that in the code.
7070+ putenv('TTRSS_CHECK_FOR_UPDATES=false');
69717070- define('FORCE_ARTICLE_PURGE', ${toString cfg.forceArticlePurge});
7171- define('SESSION_COOKIE_LIFETIME', ${toString cfg.sessionCookieLifetime});
7272- define('ENABLE_GZIP_OUTPUT', ${boolToString cfg.enableGZipOutput});
7272+ putenv('TTRSS_FORCE_ARTICLE_PURGE=${toString cfg.forceArticlePurge}');
7373+ putenv('TTRSS_SESSION_COOKIE_LIFETIME=${toString cfg.sessionCookieLifetime}');
7474+ putenv('TTRSS_ENABLE_GZIP_OUTPUT=${boolToString cfg.enableGZipOutput}');
73757474- define('PLUGINS', '${builtins.concatStringsSep "," cfg.plugins}');
7676+ putenv('TTRSS_PLUGINS=${builtins.concatStringsSep "," cfg.plugins}');
75777676- define('LOG_DESTINATION', '${cfg.logDestination}');
7777- define('CONFIG_VERSION', ${toString configVersion});
7878+ putenv('TTRSS_LOG_DESTINATION=${cfg.logDestination}');
7979+ putenv('TTRSS_CONFIG_VERSION=${toString configVersion}');
788079818080- define('PUBSUBHUBBUB_ENABLED', ${boolToString cfg.pubSubHubbub.enable});
8181- define('PUBSUBHUBBUB_HUB', '${cfg.pubSubHubbub.hub}');
8282+ putenv('TTRSS_PUBSUBHUBBUB_ENABLED=${boolToString cfg.pubSubHubbub.enable}');
8383+ putenv('TTRSS_PUBSUBHUBBUB_HUB=${cfg.pubSubHubbub.hub}');
82848383- define('SPHINX_SERVER', '${cfg.sphinx.server}');
8484- define('SPHINX_INDEX', '${builtins.concatStringsSep "," cfg.sphinx.index}');
8585+ putenv('TTRSS_SPHINX_SERVER=${cfg.sphinx.server}');
8686+ putenv('TTRSS_SPHINX_INDEX=${builtins.concatStringsSep "," cfg.sphinx.index}');
85878686- define('ENABLE_REGISTRATION', ${boolToString cfg.registration.enable});
8787- define('REG_NOTIFY_ADDRESS', '${cfg.registration.notifyAddress}');
8888- define('REG_MAX_USERS', ${toString cfg.registration.maxUsers});
8888+ putenv('TTRSS_ENABLE_REGISTRATION=${boolToString cfg.registration.enable}');
8989+ putenv('TTRSS_REG_NOTIFY_ADDRESS=${cfg.registration.notifyAddress}');
9090+ putenv('TTRSS_REG_MAX_USERS=${toString cfg.registration.maxUsers}');
89919090- define('SMTP_SERVER', '${cfg.email.server}');
9191- define('SMTP_LOGIN', '${cfg.email.login}');
9292- define('SMTP_PASSWORD', '${escape ["'" "\\"] cfg.email.password}');
9393- define('SMTP_SECURE', '${cfg.email.security}');
9292+ putenv('TTRSS_SMTP_SERVER=${cfg.email.server}');
9393+ putenv('TTRSS_SMTP_LOGIN=${cfg.email.login}');
9494+ putenv('TTRSS_SMTP_PASSWORD=${escape ["'" "\\"] cfg.email.password}');
9595+ putenv('TTRSS_SMTP_SECURE=${cfg.email.security}');
94969595- define('SMTP_FROM_NAME', '${escape ["'" "\\"] cfg.email.fromName}');
9696- define('SMTP_FROM_ADDRESS', '${escape ["'" "\\"] cfg.email.fromAddress}');
9797- define('DIGEST_SUBJECT', '${escape ["'" "\\"] cfg.email.digestSubject}');
9797+ putenv('TTRSS_SMTP_FROM_NAME=${escape ["'" "\\"] cfg.email.fromName}');
9898+ putenv('TTRSS_SMTP_FROM_ADDRESS=${escape ["'" "\\"] cfg.email.fromAddress}');
9999+ putenv('TTRSS_DIGEST_SUBJECT=${escape ["'" "\\"] cfg.email.digestSubject}');
9810099101 ${cfg.extraConfig}
100102 '';
···564566 "Z '${cfg.root}' 0755 ${cfg.user} tt_rss - -"
565567 ];
566568567567- systemd.services.tt-rss =
568568- {
569569+ systemd.services = {
570570+ phpfpm-tt-rss = mkIf (cfg.pool == "${poolName}") {
571571+ restartTriggers = [ tt-rss-config pkgs.tt-rss ];
572572+ };
569573574574+ tt-rss = {
570575 description = "Tiny Tiny RSS feeds update daemon";
571576572577 preStart = let
···604609 ''}
605610 ln -sf "${tt-rss-config}" "${cfg.root}/config.php"
606611 chmod -R 755 "${cfg.root}"
612612+ chmod -R ug+rwX "${cfg.root}/${lockDir}"
613613+ chmod -R ug+rwX "${cfg.root}/${cacheDir}"
614614+ chmod -R ug+rwX "${cfg.root}/${feedIconsDir}"
607615 ''
608616609617 + (optionalString (cfg.database.type == "pgsql") ''
···640648 wantedBy = [ "multi-user.target" ];
641649 requires = optional mysqlLocal "mysql.service" ++ optional pgsqlLocal "postgresql.service";
642650 after = [ "network.target" ] ++ optional mysqlLocal "mysql.service" ++ optional pgsqlLocal "postgresql.service";
651651+ };
643652 };
644653645654 services.mysql = mkIf mysqlLocal {
+14-3
pkgs/servers/tt-rss/default.nix
···2233stdenv.mkDerivation rec {
44 pname = "tt-rss";
55- version = "2021-01-29";
66- rev = "6d8f2221b82b6a31becbeed8baf5e05ad9e053fe";
55+ year = "21";
66+ month = "06";
77+ day = "21";
88+ version = "20${year}-${month}-${day}";
99+ rev = "cd26dbe64c9b14418f0b2d826a38a35c6bf8a270";
710811 src = fetchurl {
912 url = "https://git.tt-rss.org/fox/tt-rss/archive/${rev}.tar.gz";
1010- sha256 = "124c62hck631xlq5aa1miz9rbg711ygk7z1yx92m5dfcy630l7x5";
1313+ sha256 = "1dpmzi7hknv5rk2g1iw13r8zcxcwrhkd5hhf292ml0dw3cwki0gm";
1114 };
12151316 installPhase = ''
1717+ runHook preInstall
1818+1419 mkdir $out
1520 cp -ra * $out/
2121+2222+ # see the code of Config::get_version(). you can check that the version in
2323+ # the footer of the preferences pages is not UNKNOWN
2424+ echo "${year}.${month}" > $out/version_static.txt
2525+2626+ runHook postInstall
1627 '';
17281829 meta = with lib; {