diff --git a/nixos/doc/manual/from_md/release-notes/rl-2205.section.xml b/nixos/doc/manual/from_md/release-notes/rl-2205.section.xml
index 424bf92364da..85809fbed892 100644
--- a/nixos/doc/manual/from_md/release-notes/rl-2205.section.xml
+++ b/nixos/doc/manual/from_md/release-notes/rl-2205.section.xml
@@ -1879,6 +1879,37 @@
during the time when the timer was inactive.
+
+
+ Mastodon now uses services.redis.servers to
+ start a new redis server, instead of using a global redis
+ server. This improves compatibility with other services that
+ use redis.
+
+
+ Note that this will recreate the redis database, although
+ according to the
+ Mastodon
+ docs, this is almost harmless:
+
+
+
+ Losing the Redis database is almost harmless: The only
+ irrecoverable data will be the contents of the Sidekiq
+ queues and scheduled retries of previously failed jobs. The
+ home and list feeds are stored in Redis, but can be
+ regenerated with tootctl.
+
+
+
+ If you do want to save the redis database, you can use the
+ following commands:
+
+
+redis-cli save
+cp /var/lib/redis/dump.rdb "/var/lib/redis-mastodon/dump.rdb"
+
+
If you are using Wayland you can choose to use the Ozone
diff --git a/nixos/doc/manual/release-notes/rl-2205.section.md b/nixos/doc/manual/release-notes/rl-2205.section.md
index 5168dada83b1..3f7bc913f0c5 100644
--- a/nixos/doc/manual/release-notes/rl-2205.section.md
+++ b/nixos/doc/manual/release-notes/rl-2205.section.md
@@ -699,6 +699,20 @@ In addition to numerous new and upgraded packages, this release has the followin
By default auto-upgrade will now run immediately if it would have been triggered at least
once during the time when the timer was inactive.
+- Mastodon now uses `services.redis.servers` to start a new redis server, instead of using a global redis server.
+ This improves compatibility with other services that use redis.
+
+ Note that this will recreate the redis database, although according to the [Mastodon docs](https://docs.joinmastodon.org/admin/backups/),
+ this is almost harmless:
+ > Losing the Redis database is almost harmless: The only irrecoverable data will be the contents of the Sidekiq queues and scheduled retries of previously failed jobs.
+ > The home and list feeds are stored in Redis, but can be regenerated with tootctl.
+
+ If you do want to save the redis database, you can use the following commands:
+ ```bash
+ redis-cli save
+ cp /var/lib/redis/dump.rdb "/var/lib/redis-mastodon/dump.rdb"
+ ```
+
- If you are using Wayland you can choose to use the Ozone Wayland support
in Chrome and several Electron apps by setting the environment variable
`NIXOS_OZONE_WL=1` (for example via
diff --git a/nixos/modules/services/web-apps/mastodon.nix b/nixos/modules/services/web-apps/mastodon.nix
index fbfcc33b2dce..03adaadff93d 100644
--- a/nixos/modules/services/web-apps/mastodon.nix
+++ b/nixos/modules/services/web-apps/mastodon.nix
@@ -294,7 +294,7 @@ in {
port = lib.mkOption {
description = "Redis port.";
type = lib.types.port;
- default = 6379;
+ default = 31637;
};
};
@@ -605,8 +605,10 @@ in {
enable = true;
hostname = lib.mkDefault "${cfg.localDomain}";
};
- services.redis = lib.mkIf (cfg.redis.createLocally && cfg.redis.host == "127.0.0.1") {
+ services.redis.servers.mastodon = lib.mkIf (cfg.redis.createLocally && cfg.redis.host == "127.0.0.1") {
enable = true;
+ port = cfg.redis.port;
+ bind = "127.0.0.1";
};
services.postgresql = lib.mkIf databaseActuallyCreateLocally {
enable = true;