From 7671566751226c692849c61a382fdf430e7c7049 Mon Sep 17 00:00:00 2001 From: Charlotte Van Petegem Date: Fri, 2 Aug 2024 13:43:10 +0200 Subject: [PATCH] mastodon: Save redis state over reboots --- modules/nixos/services/mastodon/default.nix | 35 +++++++++++---------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/modules/nixos/services/mastodon/default.nix b/modules/nixos/services/mastodon/default.nix index debdc07a..b2751801 100644 --- a/modules/nixos/services/mastodon/default.nix +++ b/modules/nixos/services/mastodon/default.nix @@ -7,24 +7,27 @@ }; config = lib.mkIf config.chvp.services.mastodon.enable { - chvp.services.nginx.hosts = [{ - fqdn = "social.chvp.be"; - options = { - root = "${pkgs.mastodon}/public/"; - locations = { - "/system/".alias = "/var/lib/mastodon/public-system/"; - "/".tryFiles = "$uri @proxy"; - "@proxy" = { - proxyPass = "http://unix:/run/mastodon-web/web.socket"; - proxyWebsockets = true; - }; - "/api/v1/streaming" = { - proxyPass = "http://unix:/run/mastodon-streaming/streaming.socket"; - proxyWebsockets = true; + chvp = { + base.zfs.systemLinks = [{ path = "/var/lib/redis-mastodon"; type = "cache"; }]; + services.nginx.hosts = [{ + fqdn = "social.chvp.be"; + options = { + root = "${pkgs.mastodon}/public/"; + locations = { + "/system/".alias = "/var/lib/mastodon/public-system/"; + "/".tryFiles = "$uri @proxy"; + "@proxy" = { + proxyPass = "http://unix:/run/mastodon-web/web.socket"; + proxyWebsockets = true; + }; + "/api/v1/streaming" = { + proxyPass = "http://unix:/run/mastodon-streaming/streaming.socket"; + proxyWebsockets = true; + }; }; }; - }; - }]; + }]; + }; users = { users = { mastodon.uid = 989;