mirror of
https://github.com/nix-community/home-manager
synced 2024-11-26 21:19:45 +01:00
yt-dlp: add module
yt-dlp is a cli to download videos from YouTube.com and other sites.
This commit is contained in:
parent
6ec6b2e362
commit
4cfc0a1e02
4 changed files with 57 additions and 0 deletions
2
.github/CODEOWNERS
vendored
2
.github/CODEOWNERS
vendored
|
@ -310,6 +310,8 @@ Makefile @thiagokokada
|
|||
/modules/programs/xmobar.nix @t4ccer
|
||||
/tests/modules/programs/xmobar @t4ccer
|
||||
|
||||
/modules/programs/yt-dlp.nix @marsam
|
||||
|
||||
/modules/programs/z-lua.nix @marsam
|
||||
|
||||
/modules/programs/zathura.nix @rprospero
|
||||
|
|
|
@ -682,6 +682,13 @@ in
|
|||
A new module is available: 'programs.nheko'.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2022-09-08T17:50:43+00:00";
|
||||
message = ''
|
||||
A new module is available: 'programs.yt-dlp'.
|
||||
'';
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -180,6 +180,7 @@ let
|
|||
./programs/waybar.nix
|
||||
./programs/wezterm.nix
|
||||
./programs/xmobar.nix
|
||||
./programs/yt-dlp.nix
|
||||
./programs/z-lua.nix
|
||||
./programs/zathura.nix
|
||||
./programs/zellij.nix
|
||||
|
|
47
modules/programs/yt-dlp.nix
Normal file
47
modules/programs/yt-dlp.nix
Normal file
|
@ -0,0 +1,47 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
cfg = config.programs.yt-dlp;
|
||||
|
||||
in {
|
||||
meta.maintainers = [ maintainers.marsam ];
|
||||
|
||||
options.programs.yt-dlp = {
|
||||
enable = mkEnableOption "yt-dlp";
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = pkgs.yt-dlp;
|
||||
defaultText = literalExpression "pkgs.yt-dlp";
|
||||
description = "Package providing the <command>yt-dlp</command> tool.";
|
||||
};
|
||||
|
||||
extraConfig = mkOption {
|
||||
type = types.lines;
|
||||
default = "";
|
||||
example = literalExpression ''
|
||||
--embed-thumbnail
|
||||
--embed-subs
|
||||
--sub-langs all
|
||||
--downloader aria2c
|
||||
--downloader-args aria2c:'-c -x8 -s8 -k1M'
|
||||
'';
|
||||
description = ''
|
||||
Configuration written to
|
||||
<filename>$XDG_CONFIG_HOME/yt-dlp/config</filename>. See
|
||||
<link xlink:href="https://github.com/yt-dlp/yt-dlp#configuration" />
|
||||
for explanation about possible values.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = [ cfg.package ];
|
||||
|
||||
xdg.configFile."yt-dlp/config" =
|
||||
mkIf (cfg.extraConfig != "") { text = cfg.extraConfig; };
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue