From 6aaa5993e4c1cfb205ed555d958702f9bba1770d Mon Sep 17 00:00:00 2001 From: adikro Date: Wed, 24 Dec 2025 16:21:00 +0100 Subject: a bunch of changes, renames sys to os and refactored some of the logic --- hm/soft/mpv.nix | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 hm/soft/mpv.nix (limited to 'hm/soft/mpv.nix') diff --git a/hm/soft/mpv.nix b/hm/soft/mpv.nix new file mode 100644 index 0000000..8df73e7 --- /dev/null +++ b/hm/soft/mpv.nix @@ -0,0 +1,63 @@ +{ config, lib, pkgs, ... }: +let + cfg = config.hm.soft.mpv; + shim_dir = "${pkgs.mpv-shim-default-shaders}/share/mpv-shim-default-shaders/shaders"; + anime4k_dir = "${pkgs.anime4k}" +in +{ + options.hm.soft.mpv.enable = lib.mkEnableOption "mpv media player"; + config = lib.mkIf cfg.enable { + home.packages = with pkgs; [ + anime4k + mpv-shim-default-shaders + ]; + programs.mpv = { + enable = true; + config = { + # general stuff + save-position-on-quit = true; + keep-open = "yes"; + + # video + profile = "gpu-hq"; + gpu-api = "vulkan"; + vo = "gpu-next"; + hwdec = "auto"; + + # audio + ao = "pipewire"; + sub-auto = "fuzzy"; + volume-max = "200"; + + # network streaming + demuxer-max-back-bytes = "50Mib"; + demuxer-max-bytes = "600Mib"; + demuxer-readahead-secs = 300; + force-seekable = "yes"; + + # screenshotting + screenshot-format = "png"; + screenshot-directory = "~/${config.hm.conf.xdg-dirs.mediaPath}/pics/ss"; + screenshot-template = "mpv-%f-%wH.%wM.%wS-#%#00n"; + }; + scripts = with pkgs.mpvScripts; [ + webtorrent-mpv-hook + visualizer + videoclip + thumbfast + reload + mpv-subtitle-lines + mpv-notify-send + mpv-cheatsheet + modernx + memo + autosubsync-mpv + autosub + ]; + }; + hm.soft = { + media.enable = true; + yt-dlp.enable = true; + }; + }; +} -- cgit v1.3