nix-files/hosts/common/programs/open-in-mpv.nix

40 lines
1.2 KiB
Nix
Raw Normal View History

# test: `open-in-mpv 'mpv:///open?url=https://www.youtube.com/watch?v=dQw4w9WgXcQ'`
{ pkgs, ... }:
2023-12-14 07:26:50 +00:00
{
sane.programs.open-in-mpv = {
packageUnwrapped = pkgs.open-in-mpv.overrideAttrs (upstream: {
patches = (upstream.patches or []) ++ [
(pkgs.fetchpatch {
# if i want `open-in-mpv 'mpv:///open?...'` to use a different executable than `mpv` (e.g. `xdg-open`),
# this patch is required.
# TODO: upstream (branch: dev-sane)
url = "https://git.uninsane.org/colin/open-in-mpv/commit/4d93d5fbdd3baebb6284c517cfe9fec9970c3002.patch";
name = "open-in-mpv: respect the player's `executable` config";
hash = "sha256-UkjR58mo4ifqGU2F1YhcJU14gX41XMaXwImbV+v7Tr8=";
})
];
});
2023-12-14 07:26:50 +00:00
# taken from <https://github.com/Baldomo/open-in-mpv>
fs.".config/open-in-mpv/config.yml".symlink.text = ''
players:
mpv:
name: mpv
executable: xdg-open
supported_protocols:
- http
- https
fullscreen: ""
pip: ""
2023-12-14 07:26:50 +00:00
enqueue: ""
new_window: ""
needs_ipc: false
2023-12-14 07:26:50 +00:00
flag_overrides: {}
'';
mime.associations = {
"x-scheme-handler/mpv" = "open-in-mpv.desktop";
};
2023-12-14 07:26:50 +00:00
};
}