27 lines
577 B
Nix
27 lines
577 B
Nix
{ lib, pkgs, ... }:
|
|
let
|
|
formats = (lib.flatten
|
|
(lib.crossLists (x: y: [ "${x}+${y}" ])
|
|
[
|
|
[ "bestvideo[vcodec^=av01]" "bestvideo[vcodec^=vp9]" "bestvideo[vcodec^=avc1]" "bestvideo" ]
|
|
[ "bestaudio[acodec^=opus]" "bestaudio[acodec^=mp4a]" "bestaudio" ]
|
|
])) ++ [
|
|
"best"
|
|
];
|
|
|
|
options = {
|
|
format = lib.concatStringsSep "/" formats;
|
|
};
|
|
in
|
|
{
|
|
xdg.configFile."youtube-dl/config".text = lib.concatStringsSep
|
|
"\n"
|
|
(lib.mapAttrsToList
|
|
(k: v: "--${k} ${v}")
|
|
options);
|
|
|
|
home.packages = with pkgs; [
|
|
youtube-dl
|
|
];
|
|
}
|