From 050901da2f3df87390db51ca299ab6ed51c6ec28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Thu, 30 Nov 2023 21:51:11 +0100 Subject: [PATCH] Move yt-dlp configuration from g extension --- hm/extra.nix | 12 +++++++++++- options.nix | 6 ++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/hm/extra.nix b/hm/extra.nix index 72461e2..b20de1b 100644 --- a/hm/extra.nix +++ b/hm/extra.nix @@ -3,13 +3,23 @@ config = lib.mkIf config.frogeye.extra { programs = { pandoc.enable = true; + yt-dlp = { + enable = true; + settings = { + format = "bestvideo[height<=${builtins.toString config.frogeye.desktop.maxVideoHeight}]+bestaudio/best"; + sponsorblock-mark = "all"; + sponsorblock-remove = "intro,outro,sponsor,selfpromo,preview,interaction,music_offtopic"; + sub-langs = "en,fr"; + write-auto-subs = true; + write-subs = true; + }; + }; }; home.packages = with pkgs; ([ # android tools android-tools # downloading - yt-dlp megatools # transmission TODO Collision if both transmissions are active? diff --git a/options.nix b/options.nix index 3ce3b36..0242b89 100644 --- a/options.nix +++ b/options.nix @@ -5,6 +5,11 @@ desktop = { xorg = lib.mkEnableOption "Enable X11 support"; nixGLIntel = lib.mkEnableOption "Enable nixGLIntel/nixVulkanIntel for windows manager"; + maxVideoHeight = lib.mkOption { + type = lib.types.int; + description = "Maximum video height in pixel the machine can reasonably watch"; + default = 1080; + }; }; dev = { ansible = lib.mkEnableOption "Ansible dev stuff"; @@ -16,6 +21,7 @@ dotfiles = { path = lib.mkOption { type = lib.types.str; + description = "Absolute path to the present dotfiles directory"; # default = "${config.home.homeDirectory}/.config/dotfiles"; # FIXME Above doesn't work outside home-manager context default = "/home/geoffrey/.config/dotfiles";