Commit 20c9782e authored by Charlie Egan's avatar Charlie Egan
Browse files

nixos/navidrome: Add environmentFile config option



This is intended to be used to set secret environment variables for
navidrome, such as ListenBrainz/LastFM API keys.

Signed-off-by: default avatarCharlie Egan <charlieegan3@users.noreply.github.com>
parent d7d81bbc
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -77,6 +77,12 @@ in
        default = false;
        description = "Whether to open the TCP port in the firewall";
      };

      environmentFile = lib.mkOption {
        type = lib.types.nullOr lib.types.path;
        default = null;
        description = "Environment file, used to set any secret ND_* environment variables.";
      };
    };
  };

@@ -105,6 +111,7 @@ in
            ExecStart = ''
              ${getExe cfg.package} --configfile ${settingsFormat.generate "navidrome.json" cfg.settings}
            '';
            EnvironmentFile = lib.mkIf (cfg.environmentFile != null) [ cfg.environmentFile ];
            User = cfg.user;
            Group = cfg.group;
            StateDirectory = "navidrome";