firefox: fix open-in-mpv integration
two parts: add open-in-mpv's config to firefox's sandbox; patch open-in-mpv to forward to xdg-open
This commit is contained in:
parent
4a3d24be3f
commit
2f699737f5
|
@ -240,6 +240,7 @@ in
|
||||||
sandbox.whitelistDbus = [ "user" ]; # mpris
|
sandbox.whitelistDbus = [ "user" ]; # mpris
|
||||||
sandbox.whitelistWayland = true;
|
sandbox.whitelistWayland = true;
|
||||||
sandbox.extraHomePaths = [
|
sandbox.extraHomePaths = [
|
||||||
|
".local/share/applications" #< this might be needed only for custom schemes (like mpv:// for open-in-mpv)?
|
||||||
"dev" # for developing anything web-related
|
"dev" # for developing anything web-related
|
||||||
"tmp"
|
"tmp"
|
||||||
"Pictures"
|
"Pictures"
|
||||||
|
@ -256,6 +257,8 @@ in
|
||||||
".ssh/id_ed25519"
|
".ssh/id_ed25519"
|
||||||
# ".config/sops"
|
# ".config/sops"
|
||||||
"private/knowledge/secrets/accounts"
|
"private/knowledge/secrets/accounts"
|
||||||
|
] ++ lib.optionals cfg.addons.open-in-mpv.enable [
|
||||||
|
".config/open-in-mpv"
|
||||||
];
|
];
|
||||||
fs.".config/sops".dir = lib.mkIf cfg.addons.browserpass-extension.enable {}; #< needs to be created, not *just* added to the sandbox
|
fs.".config/sops".dir = lib.mkIf cfg.addons.browserpass-extension.enable {}; #< needs to be created, not *just* added to the sandbox
|
||||||
|
|
||||||
|
|
|
@ -1,18 +1,39 @@
|
||||||
{ ... }:
|
# test: `open-in-mpv 'mpv:///open?url=https://www.youtube.com/watch?v=dQw4w9WgXcQ'`
|
||||||
|
{ pkgs, ... }:
|
||||||
{
|
{
|
||||||
sane.programs.open-in-mpv = {
|
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=";
|
||||||
|
})
|
||||||
|
];
|
||||||
|
});
|
||||||
|
|
||||||
# taken from <https://github.com/Baldomo/open-in-mpv>
|
# taken from <https://github.com/Baldomo/open-in-mpv>
|
||||||
fs.".config/open-in-mpv/config.yml".symlink.text = ''
|
fs.".config/open-in-mpv/config.yml".symlink.text = ''
|
||||||
players:
|
players:
|
||||||
mpv:
|
mpv:
|
||||||
name: mpv
|
name: mpv
|
||||||
executable: mpv
|
executable: xdg-open
|
||||||
fullscreen: "--fs"
|
supported_protocols:
|
||||||
pip: "--ontop --no-border --autofit=384x216 --geometry=98\\%:98\\%"
|
- http
|
||||||
|
- https
|
||||||
|
fullscreen: ""
|
||||||
|
pip: ""
|
||||||
enqueue: ""
|
enqueue: ""
|
||||||
new_window: ""
|
new_window: ""
|
||||||
needs_ipc: true
|
needs_ipc: false
|
||||||
flag_overrides: {}
|
flag_overrides: {}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
mime.associations = {
|
||||||
|
"x-scheme-handler/mpv" = "open-in-mpv.desktop";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user