2019-07-27 18:45:46 +00:00
|
|
|
{ stdenv, rustPlatform, fetchFromGitHub, sqlite }: let
|
2018-07-30 21:02:19 +00:00
|
|
|
|
2019-07-27 18:45:46 +00:00
|
|
|
manifest = {
|
|
|
|
description = "Bukubrow extension host application";
|
|
|
|
name = "com.samhh.bukubrow";
|
|
|
|
path = "@out@/bin/bukubrow";
|
|
|
|
type = "stdio";
|
|
|
|
};
|
|
|
|
|
|
|
|
in rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "bukubrow-host";
|
|
|
|
version = "5.0.0";
|
2018-07-30 21:02:19 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "SamHH";
|
2019-07-27 18:45:46 +00:00
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "1a3gqxj6d1shv3w0v9m8x2xr0bvcynchy778yqalxkc3x4vr0nbn";
|
2018-07-30 21:02:19 +00:00
|
|
|
};
|
|
|
|
|
2019-07-27 18:45:46 +00:00
|
|
|
cargoSha256 = "06nh99cvg3y4f98fs0j5bkidzq6fg46wk47z5jfzz5lf72ha54lk";
|
2018-07-30 21:02:19 +00:00
|
|
|
|
|
|
|
buildInputs = [ sqlite ];
|
|
|
|
|
2019-07-27 18:45:46 +00:00
|
|
|
passAsFile = [ "firefoxManifest" "chromeManifest" ];
|
|
|
|
firefoxManifest = builtins.toJSON (manifest // {
|
|
|
|
allowed_extensions = [ "bukubrow@samhh.com" ];
|
|
|
|
});
|
|
|
|
chromeManifest = builtins.toJSON (manifest // {
|
|
|
|
allowed_origins = [ "chrome-extension://ghniladkapjacfajiooekgkfopkjblpn/" ];
|
|
|
|
});
|
|
|
|
postBuild = ''
|
|
|
|
substituteAll $firefoxManifestPath firefox.json
|
|
|
|
substituteAll $chromeManifestPath chrome.json
|
|
|
|
'';
|
2018-07-30 21:02:19 +00:00
|
|
|
postInstall = ''
|
2019-07-27 18:45:46 +00:00
|
|
|
install -Dm0644 firefox.json $out/lib/mozilla/native-messaging-hosts/com.samhh.bukubrow.json
|
|
|
|
install -Dm0644 chrome.json $out/etc/chromium/native-messaging-hosts/com.samhh.bukubrow.json
|
2018-07-30 21:02:19 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Bukubrow is a WebExtension for Buku, a command-line bookmark manager";
|
2019-07-27 18:45:46 +00:00
|
|
|
homepage = https://github.com/SamHH/bukubrow-host;
|
2018-07-30 21:02:19 +00:00
|
|
|
license = licenses.gpl3;
|
|
|
|
platforms = platforms.all;
|
|
|
|
maintainers = with maintainers; [ infinisil ];
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|