mirror of
https://github.com/nmasur/dotfiles
synced 2024-11-24 02:45:37 +00:00
36 lines
843 B
Nix
36 lines
843 B
Nix
|
{ config, pkgs, lib, ... }: {
|
||
|
|
||
|
options = {
|
||
|
yt-dlp = {
|
||
|
enable = lib.mkEnableOption {
|
||
|
description = "Enable YouTube downloader.";
|
||
|
default = false;
|
||
|
};
|
||
|
};
|
||
|
};
|
||
|
|
||
|
config = lib.mkIf (config.yt-dlp.enable) {
|
||
|
home-manager.users.${config.user} = {
|
||
|
programs.yt-dlp = {
|
||
|
enable = true;
|
||
|
extraConfig = "";
|
||
|
settings = {
|
||
|
no-continue = true; # Always re-download each fragment
|
||
|
no-overwrites = true; # Don't overwrite existing files
|
||
|
download-archive = "archive.log"; # Log of archives
|
||
|
embed-metadata = true;
|
||
|
embed-thumbnail = true;
|
||
|
embed-subs = true;
|
||
|
sub-langs = "en.*";
|
||
|
concurrent-fragments = 4; # Parallel download chunks
|
||
|
};
|
||
|
};
|
||
|
|
||
|
programs.fish.shellAbbrs.yt = "yt-dlp";
|
||
|
|
||
|
};
|
||
|
|
||
|
};
|
||
|
|
||
|
}
|