Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Brave Browser Extensions #96687

Open
wangkev opened this issue Aug 30, 2020 · 6 comments
Open

Brave Browser Extensions #96687

wangkev opened this issue Aug 30, 2020 · 6 comments
Labels
0.kind: packaging request 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md

Comments

@wangkev
Copy link

wangkev commented Aug 30, 2020

Project description
Similar to chrome, can brave browser also support installation of extensions declaratively?

@pniedzwiedzinski
Copy link
Contributor

Here's what I found after a bit of research.

There're a couple of ways to install extension manually:

/usr/share/chromium/extensions

// /usr/share/chromium/extensions/pjmbgaakjkbhpopmakjoedenlfdmcdgm.json
{
    "external_crx": "/usr/lib/browserpass-chromium/browserpass-chromium-3.1.1.crx",
    "external_version": "3.1.1"
}

But this won't work now: brave/brave-browser#5761

.config/BraveSoftware/Brave-Browser/Default/Extensions

Here lives the source of every extension, but I'm not sure if just putting a new extension here will enable it. TODO

@tejing1
Copy link
Contributor

tejing1 commented Dec 8, 2020

This isn't a full solution to the problem, and it's home-manager based instead of NixOS based, but at least for extensions that are in the chrome web store, it should be possible by a minor addition to https://github.com/nix-community/home-manager/blob/master/modules/programs/chromium.nix

@pniedzwiedzinski
Copy link
Contributor

pniedzwiedzinski commented Dec 8, 2020 via email

@wangkev
Copy link
Author

wangkev commented Dec 11, 2020

Thanks for the suggestion @tejing1!
@pniedzwiedzinski, can you share how you incorporated the pull request into your configuration? I am a nix noob.

@pniedzwiedzinski
Copy link
Contributor

pniedzwiedzinski commented Dec 13, 2020

@wangkev I have not used it

But guys, I was just setting up browserpass with programs.browserpass.enable and my brave just installed the plugin!!

{ config, lib, pkgs, ... }:

with lib;

{

  options.programs.browserpass.enable = mkEnableOption "Browserpass native messaging host";

  config = mkIf config.programs.browserpass.enable {
    environment.etc = let
      appId = "com.github.browserpass.native.json";
      source = part: "${pkgs.browserpass}/lib/browserpass/${part}/${appId}";
    in {
      # chromium
      "chromium/native-messaging-hosts/${appId}".source = source "hosts/chromium";
      "chromium/policies/managed/${appId}".source = source "policies/chromium";

      # chrome
      "opt/chrome/native-messaging-hosts/${appId}".source = source "hosts/chromium";
      "opt/chrome/policies/managed/${appId}".source = source "policies/chromium";

      # vivaldi
      "opt/vivaldi/native-messaging-hosts/${appId}".source = source "hosts/chromium";
      "opt/vivaldi/policies/managed/${appId}".source = source "policies/chromium";

      # brave
      "opt/brave/native-messaging-hosts/${appId}".source = source "hosts/chromium";
      "opt/brave/policies/managed/${appId}".source = source "policies/chromium";
    };
    nixpkgs.config.firefox.enableBrowserpass = true;
  };
}

This way we could make it work!

@stale
Copy link

stale bot commented Jun 16, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: packaging request 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md
Projects
None yet
Development

No branches or pull requests

3 participants