From 58558577b7b6f166d8107276e00905f66baf98ba Mon Sep 17 00:00:00 2001 From: niten Date: Sun, 26 Nov 2023 17:52:15 -0800 Subject: [PATCH] Strip newline when reading password files --- frigate-container.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/frigate-container.nix b/frigate-container.nix index 226cef5..54b99f4 100644 --- a/frigate-container.nix +++ b/frigate-container.nix @@ -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;