move yt-dlp to separate file

This commit is contained in:
Noah Masur 2023-03-08 22:56:07 -05:00
parent d5b0405b99
commit 71d0d3ca14
5 changed files with 42 additions and 1 deletions

View File

@ -49,6 +49,7 @@ nixpkgs.lib.nixosSystem {
# mullvad.enable = true;
nixlang.enable = true;
dotfiles.enable = true;
yt-dlp.enable = true;
gaming = {
enable = true;

View File

@ -10,6 +10,7 @@
./obsidian.nix
./qbittorrent.nix
./nautilus.nix
./yt-dlp.nix
];
}

View File

@ -16,7 +16,6 @@
sxiv # Image viewer
mupdf # PDF viewer
zathura # PDF viewer
yt-dlp # Video downloader
];
# Set default for opening PDFs

View File

@ -0,0 +1,35 @@
{ 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";
};
};
}

View File

@ -32,6 +32,11 @@
};
home-manager.users.${config.user}.xdg = {
# Allow Nix to manage the default applications list
mimeApps.enable = true;
# Set directories for application defaults
userDirs = {
enable = true;
createDirectories = true;