about summary refs log tree commit diff
path: root/modules/common/mpv.nix
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--modules/common/mpv.nix199
1 files changed, 103 insertions, 96 deletions
diff --git a/modules/common/mpv.nix b/modules/common/mpv.nix
index e857b5b..9cd1e91 100644
--- a/modules/common/mpv.nix
+++ b/modules/common/mpv.nix
@@ -4,28 +4,33 @@
   pkgs,
   ...
 }:
-with lib; let
+with lib;
+let
   cfg = config.nixfiles.modules.mpv;
-in {
+in
+{
   options.nixfiles.modules.mpv.enable = mkEnableOption "mpv";
 
   config = mkIf cfg.enable {
     hm.programs.mpv = {
       enable = true;
 
-      package = with pkgs;
-        wrapMpv (mpv-unwrapped.override {
-          bs2bSupport = false;
-          cacaSupport = false;
-          dvbinSupport = false;
-          dvdnavSupport = false;
-          swiftSupport = false;
-        }) {
-          scripts = with mpvScripts; [
-            autoload
-            sponsorblock
-          ];
-        };
+      package =
+        with pkgs;
+        wrapMpv
+          (mpv-unwrapped.override {
+            bs2bSupport = false;
+            cacaSupport = false;
+            dvbinSupport = false;
+            dvdnavSupport = false;
+            swiftSupport = false;
+          })
+          {
+            scripts = with mpvScripts; [
+              autoload
+              sponsorblock
+            ];
+          };
 
       bindings = {
         "RIGHT" = "seek 10";
@@ -63,87 +68,89 @@ in {
         "extension.jpg".profile = "extension.png";
       };
 
-      config = let
-        lang = concatStringsSep "," [
-          "Japanese"
-          "japanese"
-          "jp"
-          "jpn"
-          "jaJP"
-          "ja-JP"
-          "English"
-          "english"
-          "en"
-          "eng"
-          "enUS"
-          "en-US"
-          "Russian"
-          "russian"
-          "ru"
-          "rus"
-          "ruRU"
-          "ru-RU"
-        ];
-      in {
-        autofit-larger = "100%x95%";
-        cache = true;
-        cursor-autohide = 1000;
-        cursor-autohide-fs-only = true;
-        demuxer-max-back-bytes = "20M";
-        demuxer-max-bytes = "20M";
-        force-seekable = true;
-        fullscreen = true;
-        msg-color = true;
-        msg-module = true;
-        prefetch-playlist = true;
-        save-position-on-quit = true;
-        screenshot-format = "png";
-        screenshot-template = "%F [%p]";
-        stop-screensaver = true;
-        term-osd-bar = true;
-        use-filedir-conf = true;
-
-        osd-bar-align-y = 0;
-        osd-bar-h = 2;
-        osd-bar-w = 60;
-        osd-border-color = "#FF262626";
-        osd-border-size = 2;
-        osd-color = "#FFFFFFFF";
-        osd-duration = 1000;
-        osd-font-size = 40;
-        osd-fractions = true;
-        osd-level = 1;
-        osd-shadow-color = "#33000000";
-
-        # osc = false;
-
-        blend-subtitles = true;
-        embeddedfonts = false;
-        sub-ass-force-margins = true;
-        sub-ass-force-style = "kerning=yes";
-        sub-auto = "fuzzy";
-        sub-border-color = "#FF262626";
-        sub-border-size = 2.5;
-        sub-color = "#FFFFFFFF";
-        sub-file-paths-append = "srt";
-        sub-fix-timing = true;
-        sub-font-size = 40;
-        sub-scale-with-window = true;
-        sub-shadow-color = "#33000000";
-        sub-shadow-offset = 1;
-        sub-spacing = 0.5;
-        sub-use-margins = true;
-
-        audio-file-auto = "fuzzy";
-        volume = 100;
-        volume-max = 200;
-
-        alang = lang;
-        slang = lang;
-
-        ytdl = true;
-        ytdl-raw-options = ''sub-lang="${lang}",write-sub='';
-      };
+      config =
+        let
+          lang = concatStringsSep "," [
+            "Japanese"
+            "japanese"
+            "jp"
+            "jpn"
+            "jaJP"
+            "ja-JP"
+            "English"
+            "english"
+            "en"
+            "eng"
+            "enUS"
+            "en-US"
+            "Russian"
+            "russian"
+            "ru"
+            "rus"
+            "ruRU"
+            "ru-RU"
+          ];
+        in
+        {
+          autofit-larger = "100%x95%";
+          cache = true;
+          cursor-autohide = 1000;
+          cursor-autohide-fs-only = true;
+          demuxer-max-back-bytes = "20M";
+          demuxer-max-bytes = "20M";
+          force-seekable = true;
+          fullscreen = true;
+          msg-color = true;
+          msg-module = true;
+          prefetch-playlist = true;
+          save-position-on-quit = true;
+          screenshot-format = "png";
+          screenshot-template = "%F [%p]";
+          stop-screensaver = true;
+          term-osd-bar = true;
+          use-filedir-conf = true;
+
+          osd-bar-align-y = 0;
+          osd-bar-h = 2;
+          osd-bar-w = 60;
+          osd-border-color = "#FF262626";
+          osd-border-size = 2;
+          osd-color = "#FFFFFFFF";
+          osd-duration = 1000;
+          osd-font-size = 40;
+          osd-fractions = true;
+          osd-level = 1;
+          osd-shadow-color = "#33000000";
+
+          # osc = false;
+
+          blend-subtitles = true;
+          embeddedfonts = false;
+          sub-ass-force-margins = true;
+          sub-ass-force-style = "kerning=yes";
+          sub-auto = "fuzzy";
+          sub-border-color = "#FF262626";
+          sub-border-size = 2.5;
+          sub-color = "#FFFFFFFF";
+          sub-file-paths-append = "srt";
+          sub-fix-timing = true;
+          sub-font-size = 40;
+          sub-scale-with-window = true;
+          sub-shadow-color = "#33000000";
+          sub-shadow-offset = 1;
+          sub-spacing = 0.5;
+          sub-use-margins = true;
+
+          audio-file-auto = "fuzzy";
+          volume = 100;
+          volume-max = 200;
+
+          alang = lang;
+          slang = lang;
+
+          ytdl = true;
+          ytdl-raw-options = ''sub-lang="${lang}",write-sub='';
+        };
     };
   };
 }

Consider giving Nix/NixOS a try! <3