{ config, lib, pkgs, ... }: { options.my.shell.multimedia.enable = lib.mkEnableOption "multimedia CLI tools and codecs"; config = lib.mkIf config.my.shell.multimedia.enable { sops.secrets."gallery-dl/secrets" = { sopsFile = ../../secrets/gallery.yaml; owner = "jawz"; mode = "0400"; }; home-manager.users.jawz.programs = { yt-dlp = { enable = true; settings = { embed-thumbnail = true; embed-subs = true; sub-langs = "all"; cookies-from-browser = "firefox+gcr_4:/home/jawz/.librewolf/jawz"; }; }; gallery-dl = { enable = true; settings = import ../../dotfiles/gallery-dl.nix; }; ${config.my.shell.type} = { initExtra = lib.mkAfter '' if [ -r "${config.sops.secrets."gallery-dl/secrets".path}" ]; then set -a # automatically export all variables source "${config.sops.secrets."gallery-dl/secrets".path}" set +a # stop automatically exporting fi ''; }; }; users.users.jawz.packages = builtins.attrValues { inherit (pkgs) ffmpeg # not ffmpreg, the coolest video conversion tool! imagemagick # photoshop what?? ffpb # make ffmpeg encoding... a bit fun ; }; }; }