Files
nixpkgs/pkgs/by-name/ff/ff2mpv-rust/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

63 lines
1.6 KiB
Nix

{
lib,
rustPlatform,
fetchFromGitHub,
}:
let
firefoxPaths = [
"lib/mozilla/native-messaging-hosts"
# wrapFirefox only links lib/mozilla path, so this is ineffective
# Still the above path works, despite documentation stating otherwise
# See: https://librewolf.net/docs/faq/#how-do-i-get-native-messaging-to-work
# "lib/librewolf/native-messaging-hosts"
];
chromiumPaths = [
"etc/chromium/native-messaging-hosts"
"etc/opt/vivaldi/native-messaging-hosts"
"etc/opt/chrome/native-messaging-hosts"
"etc/opt/edge/native-messaging-hosts"
];
in
rustPlatform.buildRustPackage rec {
pname = "ff2mpv-rust";
version = "1.1.7";
src = fetchFromGitHub {
owner = "ryze312";
repo = "ff2mpv-rust";
rev = version;
hash = "sha256-kJpKcwwwGjFYE7R4ZhkEGK44QqxsUEB/Scj0RoySta4=";
};
cargoHash = "sha256-O8OAynSdZdtqNS+wAQ1oAs2HjueC41O8RFqESRHr+6o=";
postInstall = ''
$out/bin/ff2mpv-rust manifest > manifest.json
$out/bin/ff2mpv-rust manifest_chromium > manifest_chromium.json
for path in ${toString firefoxPaths}
do
mkdir -p "$out/$path"
cp manifest.json "$out/$path/ff2mpv.json"
done
for path in ${toString chromiumPaths}
do
mkdir -p "$out/$path"
cp manifest_chromium.json "$out/$path/ff2mpv.json"
done
'';
meta = with lib; {
description = "Native messaging host for ff2mpv written in Rust";
homepage = "https://github.com/ryze312/ff2mpv-rust";
license = licenses.gpl3Only;
maintainers = with maintainers; [ ryze ];
mainProgram = "ff2mpv-rust";
};
}