nixpkgs/pkgs/by-name/op/open-in-mpv/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

40 lines
1.1 KiB
Nix

{ lib
, buildGoModule
, fetchFromGitHub
}:
buildGoModule rec {
pname = "open-in-mpv";
version = "2.3.0";
src = fetchFromGitHub {
owner = "Baldomo";
repo = "open-in-mpv";
rev = "v${version}";
hash = "sha256-XlP8bGlftyNHoJI+yiVHVvd2Qa80miJdXqt+qljYNys=";
};
vendorHash = "sha256-G6GZO2+CfEAYcf7zBcqDa808A0eJjM8dq7+4VGZ+P4c=";
ldflags = [ "-s" "-w" ];
postInstall = ''
install -Dm444 -t $out/share/applications scripts/open-in-mpv.desktop
'';
meta = with lib; {
description = "Simple web extension to open videos in mpv";
longDescription = ''
To function the browser extension must be installed and open-in-mpv must be set as the default scheme-handler for mpv:// eg.:
xdg-mime default open-in-mpv.desktop x-scheme-handler/mpv
https://addons.mozilla.org/en-US/firefox/addon/iina-open-in-mpv/
https://chrome.google.com/webstore/detail/open-in-mpv/ggijpepdpiehgbiknmfpfbhcalffjlbj
'';
homepage = "https://github.com/Baldomo/open-in-mpv";
license = licenses.gpl3Only;
maintainers = with maintainers; [ SuperSandro2000 ];
mainProgram = "open-in-mpv";
};
}