nix-configs

Personal NixOS and home-manager configuration files
Log | Files | Refs

mpv.nix (1163B)


      1 { pkgs, ... }:
      2 
      3 {
      4   programs.mpv = {
      5     enable = true;
      6     config = {
      7       volume = 50; # initial volume
      8       target-colorspace-hint = "no"; # fullscreen/windowed brightness issues
      9       audio-display = "no";
     10       sub-auto = "fuzzy";
     11       ytdl-raw-options = "sub-format=en,write-srt=";
     12       ytdl-format = "bestvideo[height<=?480][fps<=?30]+bestaudio/best";
     13     };
     14     scripts = with pkgs.mpvScripts; [ sponsorblock-minimal ];
     15 
     16     profiles = builtins.listToAttrs (
     17       map (ext: { name = "extension.${ext}"; value = { loop-file = "inf"; }; })
     18       [ "gif" "webm" ]
     19       ++
     20       map (ext: { name = "extension.${ext}"; value = { pause = "yes"; }; })
     21       [ "jpg" "jpeg" "webp" "png" "avif" ]
     22     );
     23 
     24     bindings = {
     25       "-" = "add volume -5";
     26       "=" = "add volume 5";
     27       PGDWN = "playlist-prev";
     28       PGUP = "playlist-next";
     29       x = "cycle sub";
     30       X = "cycle sub-visibility";
     31       "Ctrl+n" = "af toggle acompressor";
     32       "Alt+-" = "add video-zoom -0.02";
     33       "Alt+=" = "add video-zoom 0.02";
     34       RIGHT = "osd-msg-bar seek +5 exact";
     35       LEFT = "osd-msg-bar seek -5 exact";
     36       "ctrl+del" = "run rm '$\{path\}'";
     37     };
     38   };
     39 }