{ config, inputs, lib, osConfig ? null, pkgs, ... }: let shellType = inputs.self.lib.hmShellType config osConfig; hm = inputs.self.lib.hmModule { inherit config inputs osConfig ; optionPath = [ "shell" "multimedia" ]; }; cfg = config.my.shell.multimedia; multimedia = import ./common.nix { inherit pkgs; }; in { options.my.shell.multimedia.enable = lib.mkEnableOption "multimedia CLI tools and codecs"; config = lib.mkMerge [ { my.shell.multimedia.enable = lib.mkDefault hm.enabledByDefault; } (lib.mkIf cfg.enable { home.packages = multimedia.packages; programs = { yt-dlp = { enable = true; settings = { embed-thumbnail = true; embed-subs = true; sub-langs = "all"; cookies-from-browser = "firefox+gnomekeyring:${config.home.homeDirectory}/.librewolf/${config.home.username}"; }; }; gallery-dl = { enable = true; settings = inputs.self.lib.importDotfile ../../../dotfiles/gallery-dl.nix; }; ${shellType}.initExtra = lib.mkAfter ( if osConfig == null then "" else '' if [ -r "${osConfig.sops.secrets."gallery-dl/secrets".path}" ]; then set -a source "${osConfig.sops.secrets."gallery-dl/secrets".path}" set +a fi '' ); }; }) ]; }