2024-02-15 09:14:57 +00:00
|
|
|
# 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 = {
|
2024-02-15 09:14:57 +00:00
|
|
|
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.
|
2024-02-15 11:38:37 +00:00
|
|
|
# PR against upstream (merged 2024/02/15): <https://github.com/Baldomo/open-in-mpv/pull/26>
|
2024-02-15 09:14:57 +00:00
|
|
|
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=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
});
|
|
|
|
|
2024-02-15 09:49:03 +00:00
|
|
|
sandbox.method = "bwrap";
|
|
|
|
sandbox.wrapperType = "wrappedDerivation";
|
|
|
|
sandbox.whitelistDbus = [ "user" ]; # for xdg-open/portals
|
|
|
|
|
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
|
2024-02-15 09:14:57 +00:00
|
|
|
executable: xdg-open
|
|
|
|
supported_protocols:
|
|
|
|
- http
|
|
|
|
- https
|
|
|
|
fullscreen: ""
|
|
|
|
pip: ""
|
2023-12-14 07:26:50 +00:00
|
|
|
enqueue: ""
|
|
|
|
new_window: ""
|
2024-02-15 09:14:57 +00:00
|
|
|
needs_ipc: false
|
2023-12-14 07:26:50 +00:00
|
|
|
flag_overrides: {}
|
|
|
|
'';
|
2024-02-15 09:14:57 +00:00
|
|
|
|
|
|
|
mime.associations = {
|
|
|
|
"x-scheme-handler/mpv" = "open-in-mpv.desktop";
|
|
|
|
};
|
2023-12-14 07:26:50 +00:00
|
|
|
};
|
|
|
|
}
|