nix-configs

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

mpv.nix (1086B)


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