yt-dlp: generate config if settings or extraConfig are defined (#4018)

Previously, the config was generated only if settings were defined. In a
case where settings weren't defined, extraConfig was ignored.
This commit is contained in:
Dany Marcoux 2023-05-25 15:06:34 +02:00 committed by GitHub
parent 58eb968c21
commit d1f04b0f36
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 31 additions and 5 deletions

View file

@ -66,9 +66,11 @@ in {
config = mkIf cfg.enable {
home.packages = [ cfg.package ];
xdg.configFile."yt-dlp/config" = mkIf (cfg.settings != { }) {
text = concatStringsSep "\n"
(remove "" (renderSettings cfg.settings ++ [ cfg.extraConfig ])) + "\n";
};
xdg.configFile."yt-dlp/config" =
mkIf (cfg.settings != { } || cfg.extraConfig != "") {
text = concatStringsSep "\n"
(remove "" (renderSettings cfg.settings ++ [ cfg.extraConfig ]))
+ "\n";
};
};
}