@@ -40,7 +40,7 @@ let
4040 }
4141 ''}
4242
43− ${credentialsPlaceholder cfg.credentials}
43+ ${optionalString (cfg.credentials != []) (credentialsPlaceholder cfg.credentials)}
4444
4545 ${cfg.extraConfig}
4646 '';
@@ -234,9 +234,10 @@ in {
234234 ExecStartPre = pkgs.writeShellScript "mpd-start-pre" ''
235235 set -euo pipefail
236236 install -m 600 ${mpdConf} /run/mpd/mpd.conf
237− ${pkgs.replace}/bin/replace-literal -fe ${
237+ ${optionalString (cfg.credentials != [])
238+ "${pkgs.replace}/bin/replace-literal -fe ${
238239 concatStringsSep " -a " (imap0 (i: c: "\"{{password-${toString i}}}\" \"$(cat ${c.passwordFile})\"") cfg.credentials)
239− } /run/mpd/mpd.conf
240+ } /run/mpd/mpd.conf"}
240241 '';
241242 RuntimeDirectory = "mpd";
242243 Type = "notify";