···572 </listitem>
573 <listitem>
574 <para>
00000000000575 The following Visual Studio Code extensions were renamed to
576 keep the naming convention uniform.
577 </para>
···572 </listitem>
573 <listitem>
574 <para>
575+ <literal>tt-rss</literal> was upgraded to the commit on
576+ 2021-06-21, which has breaking changes. If you use
577+ <literal>services.tt-rss.extraConfig</literal> you should
578+ migrate to the <literal>putenv</literal>-style configuration.
579+ See
580+ <link xlink:href="https://community.tt-rss.org/t/rip-config-php-hello-classes-config-php/4337">this
581+ Discourse post</link> in the tt-rss forums for more details.
582+ </para>
583+ </listitem>
584+ <listitem>
585+ <para>
586 The following Visual Studio Code extensions were renamed to
587 keep the naming convention uniform.
588 </para>
+2
nixos/doc/manual/release-notes/rl-2111.section.md
···146147- the `mingw-64` package has been upgraded from 6.0.0 to 9.0.0
14800149- The following Visual Studio Code extensions were renamed to keep the naming convention uniform.
150 - `bbenoist.Nix` -> `bbenoist.nix`
151 - `CoenraadS.bracket-pair-colorizer` -> `coenraads.bracket-pair-colorizer`
···146147- the `mingw-64` package has been upgraded from 6.0.0 to 9.0.0
148149+- `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.
150+151- The following Visual Studio Code extensions were renamed to keep the naming convention uniform.
152 - `bbenoist.Nix` -> `bbenoist.nix`
153 - `CoenraadS.bracket-pair-colorizer` -> `coenraads.bracket-pair-colorizer`
+68-59
nixos/modules/services/web-apps/tt-rss.nix
···19 mysqlLocal = cfg.database.createLocally && cfg.database.type == "mysql";
20 pgsqlLocal = cfg.database.createLocally && cfg.database.type == "pgsql";
2122- tt-rss-config = pkgs.writeText "config.php" ''
00000000023 <?php
02425- define('PHP_EXECUTABLE', '${pkgs.php}/bin/php');
26-27- define('LOCK_DIRECTORY', '${lockDir}');
28- define('CACHE_DIR', '${cacheDir}');
29- define('ICONS_DIR', '${feedIconsDir}');
30- define('ICONS_URL', '${feedIconsDir}');
31- define('SELF_URL_PATH', '${cfg.selfUrlPath}');
3233- define('MYSQL_CHARSET', 'UTF8');
3435- define('DB_TYPE', '${cfg.database.type}');
36- define('DB_HOST', '${optionalString (cfg.database.host != null) cfg.database.host}');
37- define('DB_USER', '${cfg.database.user}');
38- define('DB_NAME', '${cfg.database.name}');
39- define('DB_PASS', ${
40- if (cfg.database.password != null) then
41- "'${(escape ["'" "\\"] cfg.database.password)}'"
42- else if (cfg.database.passwordFile != null) then
43- "file_get_contents('${cfg.database.passwordFile}')"
44- else
45- "''"
46- });
47- define('DB_PORT', '${toString dbPort}');
4849- define('AUTH_AUTO_CREATE', ${boolToString cfg.auth.autoCreate});
50- define('AUTH_AUTO_LOGIN', ${boolToString cfg.auth.autoLogin});
5152- define('FEED_CRYPT_KEY', '${escape ["'" "\\"] cfg.feedCryptKey}');
535455- define('SINGLE_USER_MODE', ${boolToString cfg.singleUserMode});
5657- define('SIMPLE_UPDATE_MODE', ${boolToString cfg.simpleUpdateMode});
5859- // Never check for updates - the running version of the code should be
60- // controlled entirely by the version of TT-RSS active in the current Nix
61- // profile. If TT-RSS updates itself to a version requiring a database
62- // schema upgrade, and then the SystemD tt-rss.service is restarted, the
63- // old code copied from the Nix store will overwrite the updated version,
64- // causing the code to detect the need for a schema "upgrade" (since the
65- // schema version in the database is different than in the code), but the
66- // update schema operation in TT-RSS will do nothing because the schema
67- // version in the database is newer than that in the code.
68- define('CHECK_FOR_UPDATES', false);
06970- define('FORCE_ARTICLE_PURGE', ${toString cfg.forceArticlePurge});
71- define('SESSION_COOKIE_LIFETIME', ${toString cfg.sessionCookieLifetime});
72- define('ENABLE_GZIP_OUTPUT', ${boolToString cfg.enableGZipOutput});
7374- define('PLUGINS', '${builtins.concatStringsSep "," cfg.plugins}');
7576- define('LOG_DESTINATION', '${cfg.logDestination}');
77- define('CONFIG_VERSION', ${toString configVersion});
787980- define('PUBSUBHUBBUB_ENABLED', ${boolToString cfg.pubSubHubbub.enable});
81- define('PUBSUBHUBBUB_HUB', '${cfg.pubSubHubbub.hub}');
8283- define('SPHINX_SERVER', '${cfg.sphinx.server}');
84- define('SPHINX_INDEX', '${builtins.concatStringsSep "," cfg.sphinx.index}');
8586- define('ENABLE_REGISTRATION', ${boolToString cfg.registration.enable});
87- define('REG_NOTIFY_ADDRESS', '${cfg.registration.notifyAddress}');
88- define('REG_MAX_USERS', ${toString cfg.registration.maxUsers});
8990- define('SMTP_SERVER', '${cfg.email.server}');
91- define('SMTP_LOGIN', '${cfg.email.login}');
92- define('SMTP_PASSWORD', '${escape ["'" "\\"] cfg.email.password}');
93- define('SMTP_SECURE', '${cfg.email.security}');
9495- define('SMTP_FROM_NAME', '${escape ["'" "\\"] cfg.email.fromName}');
96- define('SMTP_FROM_ADDRESS', '${escape ["'" "\\"] cfg.email.fromAddress}');
97- define('DIGEST_SUBJECT', '${escape ["'" "\\"] cfg.email.digestSubject}');
9899 ${cfg.extraConfig}
100 '';
···564 "Z '${cfg.root}' 0755 ${cfg.user} tt_rss - -"
565 ];
566567- systemd.services.tt-rss =
568- {
005690570 description = "Tiny Tiny RSS feeds update daemon";
571572 preStart = let
···604 ''}
605 ln -sf "${tt-rss-config}" "${cfg.root}/config.php"
606 chmod -R 755 "${cfg.root}"
000607 ''
608609 + (optionalString (cfg.database.type == "pgsql") ''
···640 wantedBy = [ "multi-user.target" ];
641 requires = optional mysqlLocal "mysql.service" ++ optional pgsqlLocal "postgresql.service";
642 after = [ "network.target" ] ++ optional mysqlLocal "mysql.service" ++ optional pgsqlLocal "postgresql.service";
0643 };
644645 services.mysql = mkIf mysqlLocal {
···19 mysqlLocal = cfg.database.createLocally && cfg.database.type == "mysql";
20 pgsqlLocal = cfg.database.createLocally && cfg.database.type == "pgsql";
2122+ tt-rss-config = let
23+ password =
24+ if (cfg.database.password != null) then
25+ "${(escape ["'" "\\"] cfg.database.password)}"
26+ else if (cfg.database.passwordFile != null) then
27+ "file_get_contents('${cfg.database.passwordFile}'"
28+ else
29+ ""
30+ ;
31+ in pkgs.writeText "config.php" ''
32 <?php
33+ putenv('TTRSS_PHP_EXECUTABLE=${pkgs.php}/bin/php');
3435+ putenv('TTRSS_LOCK_DIRECTORY=${lockDir}');
36+ putenv('TTRSS_CACHE_DIR=${cacheDir}');
37+ putenv('TTRSS_ICONS_DIR=${feedIconsDir}');
38+ putenv('TTRSS_ICONS_URL=${feedIconsDir}');
39+ putenv('TTRSS_SELF_URL_PATH=${cfg.selfUrlPath}');
004041+ putenv('TTRSS_MYSQL_CHARSET=UTF8');
4243+ putenv('TTRSS_DB_TYPE=${cfg.database.type}');
44+ putenv('TTRSS_DB_HOST=${optionalString (cfg.database.host != null) cfg.database.host}');
45+ putenv('TTRSS_DB_USER=${cfg.database.user}');
46+ putenv('TTRSS_DB_NAME=${cfg.database.name}');
47+ putenv('TTRSS_DB_PASS=${password}');
48+ putenv('TTRSS_DB_PORT=${toString dbPort}');
00000004950+ putenv('TTRSS_AUTH_AUTO_CREATE=${boolToString cfg.auth.autoCreate}');
51+ putenv('TTRSS_AUTH_AUTO_LOGIN=${boolToString cfg.auth.autoLogin}');
5253+ putenv('TTRSS_FEED_CRYPT_KEY=${escape ["'" "\\"] cfg.feedCryptKey}');
545556+ putenv('TTRSS_SINGLE_USER_MODE=${boolToString cfg.singleUserMode}');
5758+ putenv('TTRSS_SIMPLE_UPDATE_MODE=${boolToString cfg.simpleUpdateMode}');
5960+ # Never check for updates - the running version of the code should
61+ # be controlled entirely by the version of TT-RSS active in the
62+ # current Nix profile. If TT-RSS updates itself to a version
63+ # requiring a database schema upgrade, and then the SystemD
64+ # tt-rss.service is restarted, the old code copied from the Nix
65+ # store will overwrite the updated version, causing the code to
66+ # detect the need for a schema "upgrade" (since the schema version
67+ # in the database is different than in the code), but the update
68+ # schema operation in TT-RSS will do nothing because the schema
69+ # version in the database is newer than that in the code.
70+ putenv('TTRSS_CHECK_FOR_UPDATES=false');
7172+ putenv('TTRSS_FORCE_ARTICLE_PURGE=${toString cfg.forceArticlePurge}');
73+ putenv('TTRSS_SESSION_COOKIE_LIFETIME=${toString cfg.sessionCookieLifetime}');
74+ putenv('TTRSS_ENABLE_GZIP_OUTPUT=${boolToString cfg.enableGZipOutput}');
7576+ putenv('TTRSS_PLUGINS=${builtins.concatStringsSep "," cfg.plugins}');
7778+ putenv('TTRSS_LOG_DESTINATION=${cfg.logDestination}');
79+ putenv('TTRSS_CONFIG_VERSION=${toString configVersion}');
808182+ putenv('TTRSS_PUBSUBHUBBUB_ENABLED=${boolToString cfg.pubSubHubbub.enable}');
83+ putenv('TTRSS_PUBSUBHUBBUB_HUB=${cfg.pubSubHubbub.hub}');
8485+ putenv('TTRSS_SPHINX_SERVER=${cfg.sphinx.server}');
86+ putenv('TTRSS_SPHINX_INDEX=${builtins.concatStringsSep "," cfg.sphinx.index}');
8788+ putenv('TTRSS_ENABLE_REGISTRATION=${boolToString cfg.registration.enable}');
89+ putenv('TTRSS_REG_NOTIFY_ADDRESS=${cfg.registration.notifyAddress}');
90+ putenv('TTRSS_REG_MAX_USERS=${toString cfg.registration.maxUsers}');
9192+ putenv('TTRSS_SMTP_SERVER=${cfg.email.server}');
93+ putenv('TTRSS_SMTP_LOGIN=${cfg.email.login}');
94+ putenv('TTRSS_SMTP_PASSWORD=${escape ["'" "\\"] cfg.email.password}');
95+ putenv('TTRSS_SMTP_SECURE=${cfg.email.security}');
9697+ putenv('TTRSS_SMTP_FROM_NAME=${escape ["'" "\\"] cfg.email.fromName}');
98+ putenv('TTRSS_SMTP_FROM_ADDRESS=${escape ["'" "\\"] cfg.email.fromAddress}');
99+ putenv('TTRSS_DIGEST_SUBJECT=${escape ["'" "\\"] cfg.email.digestSubject}');
100101 ${cfg.extraConfig}
102 '';
···566 "Z '${cfg.root}' 0755 ${cfg.user} tt_rss - -"
567 ];
568569+ systemd.services = {
570+ phpfpm-tt-rss = mkIf (cfg.pool == "${poolName}") {
571+ restartTriggers = [ tt-rss-config pkgs.tt-rss ];
572+ };
573574+ tt-rss = {
575 description = "Tiny Tiny RSS feeds update daemon";
576577 preStart = let
···609 ''}
610 ln -sf "${tt-rss-config}" "${cfg.root}/config.php"
611 chmod -R 755 "${cfg.root}"
612+ chmod -R ug+rwX "${cfg.root}/${lockDir}"
613+ chmod -R ug+rwX "${cfg.root}/${cacheDir}"
614+ chmod -R ug+rwX "${cfg.root}/${feedIconsDir}"
615 ''
616617 + (optionalString (cfg.database.type == "pgsql") ''
···648 wantedBy = [ "multi-user.target" ];
649 requires = optional mysqlLocal "mysql.service" ++ optional pgsqlLocal "postgresql.service";
650 after = [ "network.target" ] ++ optional mysqlLocal "mysql.service" ++ optional pgsqlLocal "postgresql.service";
651+ };
652 };
653654 services.mysql = mkIf mysqlLocal {