Use BOT_STATE_DIR for matrix state storage

This commit is contained in:
Abel Luck 2026-03-06 11:40:57 +01:00
parent b4fd06ef51
commit 145a3e70c3
4 changed files with 12 additions and 9 deletions

View file

@ -78,6 +78,10 @@ in
wantedBy = [ "multi-user.target" ];
wants = [ "network-online.target" ];
after = [ "network-online.target" ];
script = ''
export BOT_STATE_DIR="''${STATE_DIRECTORY}"
exec ${cfg.package}/bin/matrix-ops-bot
'';
environment = {
BOT_CONFIG_FILE = "%d/config.json";
BOT_LISTEN_HOST = cfg.listenAddress;
@ -94,7 +98,6 @@ in
// cfg.extraEnvironment;
serviceConfig = {
Type = "simple";
ExecStart = "${cfg.package}/bin/matrix-ops-bot";
DynamicUser = true;
StateDirectory = cfg.stateDirectory;
WorkingDirectory = "/var/lib/${cfg.stateDirectory}";

View file

@ -16,7 +16,6 @@ self: {
user_id = "@ops-bot:example.invalid";
password = "not-a-real-password";
device_name = "nixos-test";
store_path = "/var/lib/matrix-ops-bot/matrix";
verify_ssl = false;
};
};