Use optionalAttrs instead of mkIf in serviceConfig

mkIf doesn't merge correctly with the // operator;
optionalAttrs returns a plain set that works with //.
This commit is contained in:
didier committed 2026-06-04 08:27:15 -04:00
1 parent e0fe59d92b
commit c364a7798f
1 file changed
+1 -1
+1 -1
View File
@@ -130,7 +130,7 @@
StateDirectory = "st-pierre";
ExecStart = "${st-pierre-pkg}/bin/st-pierre";
}
// lib.mkIf (cfg.openaiApiKeyFile != null || cfg.tokenFile != null || cfg.qdrantApiKeyFile != null) {
// lib.optionalAttrs (cfg.openaiApiKeyFile != null || cfg.tokenFile != null || cfg.qdrantApiKeyFile != null) {
EnvironmentFile = lib.optional (cfg.openaiApiKeyFile != null) cfg.openaiApiKeyFile
++ lib.optional (cfg.tokenFile != null) cfg.tokenFile
++ lib.optional (cfg.qdrantApiKeyFile != null) cfg.qdrantApiKeyFile;