Referring to the discussion here How many people are paid to work on Nix/Nixpkgs? I open this topic to be able do to casual nixpkgs contributions. The idea is to lower the threshold to contribute to Nixpkgs for people like me who are not a dev, do not have a Github account, do not check out nixpkgs via git locally, are merely users, etc. etc etc but still want to share something so now and then.
Here is my first casual contribution. A sponsored PR (=someone who wants to shape it into an actual PR) would be appreciated.
{ stdenv, fetchFromGitHub, python3 }:
stdenv.mkDerivation rec {
pname = "ff2mpv-host";
version = "3.6";
src = fetchFromGitHub {
owner = "woodruffw";
repo = "ff2mpv";
rev = "v${version}";
sha256 = "0dpqd4vis4c0pvdfpkgflc6ccdm98jils3jp0ncz1nvam4swsr1x";
};
buildInputs = [ python3 ];
installPhase = ''
runHook preInstall
install -D ff2mpv.py $out/share/ff2mpv.py
substitute ff2mpv.json $out/share/ff2mpv.json \
--replace /home/william/scripts/ff2mpv $out/share/ff2mpv.py
nativeMessagingPaths=(
/lib/mozilla/native-messaging-hosts
# /etc/opt/chrome/native-messaging-hosts
# /etc/chromium/native-messaging-hosts
# /etc/vivaldi/native-messaging-hosts
)
for manifestDir in "''${nativeMessagingPaths[@]}"; do
install -d $out$manifestDir
ln -s $out/share/ff2mpv.json $out$manifestDir/
done
runHook postInstall
'';
meta = with stdenv.lib; {
description = "Host app for the WebExtension ff2mpv";
homepage = "https://github.com/woodruffw/ff2mpv";
license = licenses.mit;
};
}