From 3982b3d5abed368985dd9d325b6b544e86701d7e Mon Sep 17 00:00:00 2001 From: Soispha Date: Sat, 22 Jul 2023 17:28:02 +0200 Subject: Fix(system/services/matrix): Move persisting files ctrl to impermanence --- system/impermanence/default.nix | 1 + system/impermanence/mods/matrix.nix | 13 +++++++++++++ system/services/matrix/default.nix | 6 +++--- 3 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 system/impermanence/mods/matrix.nix diff --git a/system/impermanence/default.nix b/system/impermanence/default.nix index 198eeba..0595078 100644 --- a/system/impermanence/default.nix +++ b/system/impermanence/default.nix @@ -4,6 +4,7 @@ ./mods/acme.nix ./mods/keycloak.nix ./mods/mail.nix + ./mods/matrix.nix ./mods/minecraft.nix ./mods/nix-sync.nix ./mods/openssh.nix diff --git a/system/impermanence/mods/matrix.nix b/system/impermanence/mods/matrix.nix new file mode 100644 index 0000000..7f02609 --- /dev/null +++ b/system/impermanence/mods/matrix.nix @@ -0,0 +1,13 @@ +{...}: { + environment.persistence."/srv".directories = [ + { + directory = "/var/lib/matrix"; + user = "matrix-synapse"; + group = "matrix-synapse"; + mode = "0700"; + } + ]; + systemd.tmpfiles.rules = [ + "d /etc/matrix 0755 matrix-synapse matrix-synapse" + ]; +} diff --git a/system/services/matrix/default.nix b/system/services/matrix/default.nix index a088159..0a55e32 100644 --- a/system/services/matrix/default.nix +++ b/system/services/matrix/default.nix @@ -50,10 +50,10 @@ in { services.matrix-synapse = { enable = true; - dataDir = "/srv/matrix/data"; - configFile = "/srv/matrix"; + dataDir = "/var/lib/matrix"; + configFile = "/etc/matrix/matrix.conf"; settings = { - media_store_path = "/srv/matrix/media_store"; + media_store_path = "/var/lib/matrix/media_store"; server_name = "vhack.eu"; listeners = [ { -- cgit 1.4.1