zoxide: 0.9.6 -> 0.9.7 (#380745)
[NixPkgs.git] / pkgs / by-name / bu / bukubrow / package.nix
blob4e1108669f033b29449fff01ae3d897118fabd25
2   lib,
3   rustPlatform,
4   fetchFromGitHub,
5   sqlite,
6 }:
7 let
9   manifest = {
10     description = "Bukubrow extension host application";
11     name = "com.samhh.bukubrow";
12     path = "@out@/bin/bukubrow";
13     type = "stdio";
14   };
17 rustPlatform.buildRustPackage rec {
18   pname = "bukubrow-host";
19   version = "5.4.0";
21   src = fetchFromGitHub {
22     owner = "SamHH";
23     repo = pname;
24     rev = "v${version}";
25     sha256 = "sha256-xz5Agsm+ATQXXgpPGN4EQ00i1t8qUlrviNHauVdCu4U=";
26   };
28   useFetchCargoVendor = true;
29   cargoHash = "sha256-mCPJE9WW14NtahbMnDcE+0xXl5w25dzerPy3wv78l20=";
31   buildInputs = [ sqlite ];
33   passAsFile = [
34     "firefoxManifest"
35     "chromeManifest"
36   ];
37   firefoxManifest = builtins.toJSON (
38     manifest
39     // {
40       allowed_extensions = [ "bukubrow@samhh.com" ];
41     }
42   );
43   chromeManifest = builtins.toJSON (
44     manifest
45     // {
46       allowed_origins = [ "chrome-extension://ghniladkapjacfajiooekgkfopkjblpn/" ];
47     }
48   );
49   postBuild = ''
50     substituteAll $firefoxManifestPath firefox.json
51     substituteAll $chromeManifestPath chrome.json
52   '';
53   postInstall = ''
54     install -Dm0644 firefox.json $out/lib/mozilla/native-messaging-hosts/com.samhh.bukubrow.json
55     install -Dm0644 chrome.json $out/etc/chromium/native-messaging-hosts/com.samhh.bukubrow.json
56   '';
58   meta = with lib; {
59     description = "WebExtension for Buku, a command-line bookmark manager";
60     homepage = "https://github.com/SamHH/bukubrow-host";
61     license = licenses.gpl3;
62     maintainers = [ ];
63     mainProgram = "bukubrow";
64   };