nix-configs

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

mpv.nix (1187B)


      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; [
     15       # mpris
     16       sponsorblock-minimal
     17     ];
     18 
     19     profiles = builtins.listToAttrs (
     20       map (ext: { name = "extension.${ext}"; value = { loop-file = "inf"; }; })
     21       [ "gif" "webm" ]
     22       ++
     23       map (ext: { name = "extension.${ext}"; value = { pause = "yes"; }; })
     24       [ "jpg" "jpeg" "webp" "png" "avif" ]
     25     );
     26 
     27     bindings = {
     28       "-" = "add volume -5";
     29       "=" = "add volume 5";
     30       PGDWN = "playlist-prev";
     31       PGUP = "playlist-next";
     32       x = "cycle sub";
     33       X = "cycle sub-visibility";
     34       "Ctrl+n" = "af toggle acompressor";
     35       "Alt+-" = "add video-zoom -0.02";
     36       "Alt+=" = "add video-zoom 0.02";
     37       RIGHT = "osd-msg-bar seek +5 exact";
     38       LEFT = "osd-msg-bar seek -5 exact";
     39       "ctrl+del" = "run rm '$\{path\}'";
     40     };
     41   };
     42 }