Fix app_service_config and RuntimeDirectory

As the nixos module now already sets a RuntimeDirectory, I had to move
stuff around and use some `lib.mkForce`.
This commit is contained in:
Jakob Lechner 2024-05-28 01:27:20 +02:00
parent c4e80d0d91
commit 5003a40a97

View file

@ -90,14 +90,18 @@ lib.mkIf cfg.enable {
)
cfg.synapse.app_service_config;
serviceConfig = {
RuntimeDirectory = "matrix-synapse/app_service_config";
RuntimeDirectory = lib.mkForce [
"matrix-synapse"
"matrix-synapse/app_service_config"
];
RuntimeDirectoryPreserve = lib.mkForce false;
ExecStartPre = lib.attrsets.mapAttrsToList
(name: value:
let
script = pkgs.writeShellScript "app_service_config-${name}"
''
cp "${value}" "$RUNTIME_DIRECTORY/${name}.yaml"
chown matrix-synapse: "$RUNTIME_DIRECTORY/${name}.yaml"
cp "${value}" "/run/matrix-synapse/app_service_config/${name}.yaml"
chown matrix-synapse: "/run/matrix-synapse/app_service_config/${name}.yaml"
'';
in
"+${script}"