From 4d0ab2e5a6e8978a857f2fd9f5a66aeb6ef5be5d Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Tue, 11 May 2021 18:46:43 +0200 Subject: [PATCH] pkgs: add ff2mpv-go --- pkgs/default.nix | 2 ++ pkgs/ff2mpv-go/default.nix | 30 ++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 pkgs/ff2mpv-go/default.nix diff --git a/pkgs/default.nix b/pkgs/default.nix index 2f21e7f..58e65cd 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -4,6 +4,8 @@ rec { diff-flake = pkgs.callPackage ./diff-flake { }; + ff2mpv-go = pkgs.callPackage ./ff2mpv-go { }; + havm = pkgs.callPackage ./havm { }; i3-get-window-criteria = pkgs.callPackage ./i3-get-window-criteria { }; diff --git a/pkgs/ff2mpv-go/default.nix b/pkgs/ff2mpv-go/default.nix new file mode 100644 index 0000000..9efcf13 --- /dev/null +++ b/pkgs/ff2mpv-go/default.nix @@ -0,0 +1,30 @@ +{ buildGoModule, fetchgit, lib, mpv }: +buildGoModule rec { + pname = "ff2mpv-go"; + version = "1.0.1"; + + src = fetchgit { + url = "https://git.clsr.net/util/ff2mpv-go/"; + rev = "v${version}"; + sha256 = "sha256-e/AuOA3isFTyBf97Zwtr16yo49UdYzvktV5PKB/eH/s="; + }; + + vendorSha256 = "sha256-pQpattmS9VmO3ZIQUFn66az8GSmB4IvYhTTCFn6SUmo="; + + postPatch = '' + sed -i -e 's,"mpv","${mpv}/bin/mpv",' ff2mpv.go + ''; + + postInstall = '' + mkdir -p "$out/lib/mozilla/native-messaging-hosts" + $out/bin/ff2mpv-go --manifest > "$out/lib/mozilla/native-messaging-hosts/ff2mpv.json" + ''; + + meta = with lib; { + description = '' + Native messaging host for ff2mpv written in Go. + ''; + homepage = "https://git.clsr.net/util/ff2mpv-go/"; + license = licenses.publicDomain; + }; +}