2021-02-05 17:12:51 +00:00
|
|
|
{ lib, rustPlatform, fetchFromGitHub, sqlite }: let
|
2020-04-24 23:36:52 +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";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "SamHH";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "1a3gqxj6d1shv3w0v9m8x2xr0bvcynchy778yqalxkc3x4vr0nbn";
|
|
|
|
};
|
|
|
|
|
2021-05-28 09:39:13 +00:00
|
|
|
cargoSha256 = "0z6i9wzz5gy9rs8cxfmwg4mpfajv0xvj4nn6jfl7f1rw6k457jc9";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildInputs = [ sqlite ];
|
|
|
|
|
|
|
|
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
|
|
|
|
'';
|
|
|
|
postInstall = ''
|
|
|
|
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
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-11-03 02:18:15 +00:00
|
|
|
description = "A WebExtension for Buku, a command-line bookmark manager";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/SamHH/bukubrow-host";
|
|
|
|
license = licenses.gpl3;
|
|
|
|
maintainers = with maintainers; [ infinisil ];
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|