Strip newline when reading password files

This commit is contained in:
niten 2023-11-26 17:52:15 -08:00
parent 191429b307
commit 58558577b7
1 changed files with 4 additions and 2 deletions

View File

@ -12,6 +12,8 @@ let
hostSecrets = config.fudo.secrets.host-secrets."${config.instance.hostname}";
removeNewline = removeSuffix "\n";
frigateCfg = let
content = builtins.toJSON {
mqtt = {
@ -188,8 +190,8 @@ in {
fudo.secrets.host-secrets."${config.instance.hostname}" = {
frigateEnv = {
source-file = let
camPasswd = readFile cfg.camera-password-file;
mqttPasswd = readFile cfg.mqtt.password-file;
camPasswd = removeNewline (readFile cfg.camera-password-file);
mqttPasswd = removeNewline (readFile cfg.mqtt.password-file);
in makeEnvFile {
FRIGATE_RTSP_PASSWORD = camPasswd;
FRIGATE_MQTT_PASSWORD = mqttPasswd;