nix-community / home-manager

Manage a user environment using Nix [maintainer=@rycee]
https://nix-community.github.io/home-manager/
MIT License
6.81k stars 1.78k forks source link

bug: chromium.extensions don't work for brave or ungoogled-chromium #2216

Open yisraeldov opened 3 years ago

yisraeldov commented 3 years ago

Is there an existing issue for this?

Issue description

See #1383

programs.chromium.extensions does not work when programs.chromium.package = brave | ungoogled-chromium

For brave first of all it doesn't install in the correct directory. It installs in .config/brave/ but brave's configs are stored in .config/BraveSoftware/Brave-Browser/, I tried manually moving the files but that doesn't work.

For ungoogled-chromium I just don't see that the extensions are being installed, I assume it should work the same as in chromium

chromium works as expected.

Maintainer CC

@colinxs @berbiche

System information

- system: `"x86_64-linux"`
 - host os: `Linux 5.13.4, NixOS, 21.05.1669.973910f5c31 (Okapi)`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.3.14`
 - channels(root): `"home-manager-21.05, nixos-21.05.1669.973910f5c31, nixos-unstable-21.11pre304061.dd14e5d78e9"`
 - channels(yisraeldov): `"nixos-21.05.1669.973910f5c31"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
ilkecan commented 3 years ago

Has this ever worked for ungoogled-chromium? I think it doesn't work because "Chrome Webstore interface" is disabled[1] on the ungoogled version. I also cannot install extensions manually from the chrome web store.

Probably not optimal, but I was able to install the extensions by first downloading them and then loading them locally, which only works for Linux:

extensions =
  let
    createChromiumExtensionFor = browserVersion: { id, sha256, version }:
      {
        inherit id;
        crxPath = builtins.fetchurl {
          url = "https://clients2.google.com/service/update2/crx?response=redirect&acceptformat=crx2,crx3&prodversion=${browserVersion}&x=id%3D${id}%26installsource%3Dondemand%26uc";
          name = "${id}.crx";
          inherit sha256;
        };
        inherit version;
      };
    createChromiumExtension = createChromiumExtensionFor (lib.versions.major package.version);
  in
  [
    (createChromiumExtension {
      # ublock origin
      id = "cjpalhdlnbpafiamejdnhcphjbkeiagm";
      sha256 = "sha256-u81DNkZw/LBVyjk5nmrrJEVjdc+GFCay+rQZGpDH3jA=";
      version = "1.37.2";
    })
    (createChromiumExtension {
      # dark reader
      id = "eimadpbcbfnmbkopoojfekhnkhdbieeh";
      sha256 = "sha256-JcM2Ki3cTWdskFEFs2jk6LQUTFOojkBf+6HqO1GPK90=";
      version = "4.9.34";
    })
  ];

[1] https://ungoogled-software.github.io/ungoogled-chromium-wiki/faq#can-i-install-extensions-or-themes-from-the-chrome-webstore

nixos-discourse commented 3 years ago

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/home-manager-ungoogled-chromium-with-extensions/15214/2

stale[bot] commented 2 years ago

Thank you for your contribution! I marked this issue as stale due to inactivity. If this remains inactive for another 7 days, I will close this issue. Please read the relevant sections below before commenting.

If you are the original author of the issue

* If this is resolved, please consider closing it so that the maintainers know not to focus on this. * If this might still be an issue, but you are not interested in promoting its resolution, please consider closing it while encouraging others to take over and reopen an issue if they care enough. * If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.

If you are not the original author of the issue

* If you are also experiencing this issue, please add details of your situation to help with the debugging process. * If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.

Memorandum on closing issues

If you have nothing of substance to add, please refrain from commenting and allow the bot close the issue. Also, don't be afraid to manually close an issue, even if it holds valuable information.

Closed issues stay in the system for people to search, read, cross-reference, or even reopen--nothing is lost! Closing obsolete issues is an important way to help maintainers focus their time and effort.

stellarhoof commented 2 years ago

Not stale

stale[bot] commented 2 years ago

Thank you for your contribution! I marked this issue as stale due to inactivity. Please be considerate of people watching this issue and receiving notifications before commenting 'I have this issue too'. We welcome additional information that will help resolve this issue. Please read the relevant sections below before commenting.

If you are the original author of the issue

* If this is resolved, please consider closing it so that the maintainers know not to focus on this. * If this might still be an issue, but you are not interested in promoting its resolution, please consider closing it while encouraging others to take over and reopen an issue if they care enough. * If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.

If you are not the original author of the issue

* If you are also experiencing this issue, please add details of your situation to help with the debugging process. * If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.

Memorandum on closing issues

Don't be afraid to manually close an issue, even if it holds valuable information. Closed issues stay in the system for people to search, read, cross-reference, or even reopen – nothing is lost! Closing obsolete issues is an important way to help maintainers focus their time and effort.

egirlcatnip commented 3 months ago

Not stale

stale[bot] commented 1 week ago

Thank you for your contribution! I marked this issue as stale due to inactivity. Please be considerate of people watching this issue and receiving notifications before commenting 'I have this issue too'. We welcome additional information that will help resolve this issue. Please read the relevant sections below before commenting.

If you are the original author of the issue

* If this is resolved, please consider closing it so that the maintainers know not to focus on this. * If this might still be an issue, but you are not interested in promoting its resolution, please consider closing it while encouraging others to take over and reopen an issue if they care enough. * If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.

If you are not the original author of the issue

* If you are also experiencing this issue, please add details of your situation to help with the debugging process. * If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.

Memorandum on closing issues

Don't be afraid to manually close an issue, even if it holds valuable information. Closed issues stay in the system for people to search, read, cross-reference, or even reopen – nothing is lost! Closing obsolete issues is an important way to help maintainers focus their time and effort.