users/foo-dogsquared: add quick script for mpv YouTube playlists

This commit is contained in:
Gabriel Arazas 2023-10-13 14:15:46 +08:00
parent 90210fde9c
commit 79a144aad6
No known key found for this signature in database
GPG Key ID: ADE0C41DAB221FCC

View File

@ -28,6 +28,22 @@ in
home.packages = with pkgs; [
hledger # Trying to be a good accountant.
# For now, it is not possible to easily play YouTube playlists until it
# is fixed in mpv (or yt-dlp). Ideally, this would be a Python script
# but I don't know jack using yt-dlp as a Python module.
(pkgs.writeShellApplication {
name = "play-mpv-playlist-from-youtube-playlist";
runtimeInputs = with pkgs; [
config.programs.mpv.package
yt-dlp
];
text = ''
yt-dlp --print id "$1" \
| xargs -I{} echo "https://www.youtube.com/watch?v={}" \
| mpv --playlist=-
'';
})
];
fonts.fontconfig.enable = true;