From eccea387595290c1ea269147e3dfd44525a9c20a Mon Sep 17 00:00:00 2001 From: Simon Bruder Date: Mon, 1 Mar 2021 17:30:58 +0100 Subject: [PATCH] =?UTF-8?q?mpv:=20Use=20youtube-dl=E2=80=99s=20default=20f?= =?UTF-8?q?ormat?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit mpv overrides my custom format with `bestvideo+bestaudio/best` (youtube-dl upstream default). This applies a patch (from upstream) that adds a magic value to remove the override. Since home-manager’s mpv module only supports overriding the mpv package in 21.05, it is done in the overlay. Fixes #39. --- pkgs/default.nix | 11 +++++++++++ users/simon/modules/mpv.nix | 3 +++ 2 files changed, 14 insertions(+) diff --git a/pkgs/default.nix b/pkgs/default.nix index 220db08..df75e64 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -17,4 +17,15 @@ in }; aria2_exporter = import srcs.aria2_exporter { pkgs = self; }; + + # FIXME: 21.05: Move to home-manager module package attribute + mpv-unwrapped = super.mpv-unwrapped.overrideAttrs (o: o // { + patches = [ + # FIXME: 21.05: Remove since it has mpv 0.33 + (super.fetchpatch { + url = "https://github.com/mpv-player/mpv/commit/43c13e5ea23230edca38426d4a9eed049a70890e.patch"; + sha256 = "0g73ws36cs2hfzqck6xiaimj5yd5hz68b4wf3qayyv4nrf5sz02c"; + }) + ]; + }); } diff --git a/users/simon/modules/mpv.nix b/users/simon/modules/mpv.nix index 08ba95c..6be09c1 100644 --- a/users/simon/modules/mpv.nix +++ b/users/simon/modules/mpv.nix @@ -103,6 +103,9 @@ in # Lossless screenshots screenshot-format = "png"; + + # Use youtube-dl’s format configuration + ytdl-format = "ytdl"; }; bindings = {