From df590320f3f282ed2a9bdaad200004b73942919a Mon Sep 17 00:00:00 2001 From: uku Date: Sun, 12 Jul 2026 10:32:34 +0200 Subject: [PATCH] nixos/matrix-authentication-service: use env var instead of %d %d works in the context of the ExecStart command, since it's expanded by systemd. However, extraConfigFiles is also used in the ExecStartPre *script*, and bash does not know what %d is, so it's not expanded and the MAS config check fails because it can't find "%d/config-0" (instead of the intended "/run/credentials/...") --- .../modules/services/matrix/matrix-authentication-service.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nixos/modules/services/matrix/matrix-authentication-service.nix b/nixos/modules/services/matrix/matrix-authentication-service.nix index 4b57643e4090..ee3c1a5d8232 100644 --- a/nixos/modules/services/matrix/matrix-authentication-service.nix +++ b/nixos/modules/services/matrix/matrix-authentication-service.nix @@ -45,7 +45,9 @@ let pruned; configFile = format.generate "config.yaml" finalSettings; - extraConfigFiles = lib.imap0 (i: _: "%d/config-${toString i}") cfg.extraConfigFiles; + extraConfigFiles = lib.imap0 ( + i: _: "\${CREDENTIALS_DIRECTORY}/config-${toString i}" + ) cfg.extraConfigFiles; runtimeConfig = "/run/matrix-authentication-service/config.yaml"; in {