Make EnvironmentFile conditional in systemd service
Only include EnvironmentFile when at least one *File option (openaiApiKeyFile, tokenFile, qdrantApiKeyFile) is set. Without this, an empty EnvironmentFile list causes systemd to fail with 'Failed to load environment files'.
This commit is contained in:
1 parent
e700a81c25
commit
e0fe59d92b
1 file changed
+2
@@ -129,6 +129,8 @@
|
||||
WorkingDirectory = "/var/lib/st-pierre";
|
||||
StateDirectory = "st-pierre";
|
||||
ExecStart = "${st-pierre-pkg}/bin/st-pierre";
|
||||
}
|
||||
// lib.mkIf (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;
|
||||
|
||||
Reference in new issue
Block a user