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

chrome-gnome-shell doesn't work in 17.09 #34184

Closed
neilmayhew opened this issue Jan 23, 2018 · 10 comments
Closed

chrome-gnome-shell doesn't work in 17.09 #34184

neilmayhew opened this issue Jan 23, 2018 · 10 comments
Labels
0.kind: question 6.topic: GNOME GNOME desktop environment and its underlying platform

Comments

@neilmayhew
Copy link
Member

Issue description

Gnome-Shell integration with chrome-gnome-shell doesn't work.

Steps to reproduce

Open Firefox or Chromium, browse to http://extensions.gnome.org. Page says extension is installed but native host connector isn't running, even when chrome-gnome-shell is installed with nix-env.

Things tried

See comments at the end of #26981

Technical details

  • system: "x86_64-linux"
  • host os: Linux 4.9.77, NixOS, 17.09.2826.5141f28405e (Hummingbird)
  • multi-user?: yes
  • sandbox: no
  • version: nix-env (Nix) 1.11.16
  • channels(user): ""
  • channels(root): "nixos-17.09.2826.5141f28405e"
  • nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs
@jtojnar
Copy link
Member

jtojnar commented Jan 23, 2018

Please read the description of the package:

To use the integration, install the <link xlink:href="https://wiki.gnome.org/Projects/GnomeShellIntegrationForChrome/Installation">browser extension</link>, and then set <option>services.gnome3.chrome-gnome-shell.enable</option> to <literal>true</literal>. For Firefox based browsers, you will also need to build the wrappers with <option>nixpkgs.config.firefox.enableGnomeExtensions</option> set to <literal>true</literal>.

@jtojnar jtojnar added 0.kind: question 6.topic: GNOME GNOME desktop environment and its underlying platform labels Jan 23, 2018
@neilmayhew
Copy link
Member Author

Thanks for the info. That's very helpful.

I hadn't seen the instructions in the description because I'm on 17.09 and these extra configuration options are only in in staging and master. Am I out of luck for getting chrome-gnome-shell working on 17.09?

I assume I could install a version of firefox from master, but I don't think I'd be able to have chrome-gnome-shell run as a service without running NixOS itself from master.

@jtojnar
Copy link
Member

jtojnar commented Jan 23, 2018

You can definitely run services from different paths. For example, if you register unstable channel to your path, you can use the following configuration.nix.

{
  imports = [
    <unstable/nixos/modules/services/desktops/gnome3/chrome-gnome-shell.nix>
  ];

  # Disable the module from the default channel
  disabledModules = [ "desktops/gnome3/chrome-gnome-shell.nix" ];

  services.gnome3.chrome-gnome-shell.enable = true;

  nixpkgs.config.firefox.enableGnomeExtensions = true;

  nixpkgs.config.packageOverrides = super: {
    firefox = unstable.firefox;

    # Not sure if this is necessary, or the module picks up the package from the channel
    chrome-gnome-shell = unstable.chrome-gnome-shell;
  };
}

@eqyiel
Copy link
Contributor

eqyiel commented Jan 24, 2018

@neilmayhew maybe have a look at the diff here: #31743

It's the PR that adds support for Browserpass (another native messaging extension) to Firefox. According to this, you can override the Firefox wrapper with extraNativeMessagingHosts.

@jtojnar
Copy link
Member

jtojnar commented Jan 24, 2018

@eqyiel that one is also only on unstable.

@eqyiel
Copy link
Contributor

eqyiel commented Jan 24, 2018

@jtojnar my bad!

@jtojnar jtojnar closed this as completed Jan 29, 2018
@neilmayhew
Copy link
Member Author

@jtojnar Unfortunately, that isn't working for me.

I added <unstable> by running sudo nix-channel --add https://nixos.org/channels/nixos-unstable unstable and ran sudo nix-channel --update.

I then put your code snippet into /etc/nixos/configuration.nix (merging the imports with the existing one that contains just ./hardware-configuration.nix) and ran nixos-rebuild build.

It says, undefined variable ‘unstable’ for the two places it's used in /etc/nixos/configuration.nix.

I'm also thinking that this part must be wrong:

{
  imports = [
    <unstable/nixos/modules/services/desktops/gnome3/chrome-gnome-shell.nix>
  ];
}

because that would merge chrome-gnome-shell.nix (a package) with ./hardware-configuration.nix (a NixOS configuration).

I've fiddled around with this a bit but haven't been able to make it work yet. If you have any further pointers, I'd appreciate it.

Currently, I have:

{ config, pkgs, options, ... }:

let
  unstable = import <unstable>;
in
{
  imports =
    [ # Include the results of the hardware scan.
      ./hardware-configuration.nix
    ];

  # Disable the module from the default channel
  disabledModules = [ "desktops/gnome3/chrome-gnome-shell.nix" ];

  services.gnome3.chrome-gnome-shell.enable = true;

  nixpkgs.config.firefox.enableGnomeExtensions = true;

  nixpkgs.config.packageOverrides = super: {
    firefox = unstable.firefox;

    # Not sure if this is necessary, or the module picks up the package from the channel
    chrome-gnome-shell = unstable.chrome-gnome-shell;
  };

  # ...
}

It fails with:

$ nixos-rebuild build
building Nix...
building the system configuration...
error: The option `services.gnome3.chrome-gnome-shell' defined in `/etc/nixos/configuration.nix' does not exist.

@jtojnar
Copy link
Member

jtojnar commented Jan 29, 2018

The setting of unstable in the let statement should be enough to fix the undefined variable errors. Adding the module to imports should work too – it merges the listed modules (including the hardware configuration) into your configuration.nix. chrome-gnome-shell.nix is a module not a package. The error you see now is caused by the module where the enable attribute is defined not being imported.

@neilmayhew
Copy link
Member Author

I got it to build a profile, with the following configuration:

{ config, pkgs, options, ... }:

let
  unstable = import <unstable> {};
in
{
  imports =
    [ # Include the results of the hardware scan.
      ./hardware-configuration.nix
      <unstable/nixos/modules/services/desktops/gnome3/chrome-gnome-shell.nix>
    ];

  # Disable the module from the default channel
  disabledModules = [ "desktops/gnome3/chrome-gnome-shell.nix" ];

  services.gnome3.chrome-gnome-shell.enable = true;

  nixpkgs.config.firefox.enableGnomeExtensions = true;

  nixpkgs.config.packageOverrides = super: {
    firefox = unstable.firefox;

    # Not sure if this is necessary, or the module picks up the package from the channel
    chrome-gnome-shell = unstable.chrome-gnome-shell;
  };

  # ...
}

but the web page still says, "native host connector is not detected". Building the profile brought in a lot of gnome and GTK stuff, so it does seem to be using things from unstable. I started firefox from the command line, using an empty profile with just the GNOME Shell integration extension installed.

Thanks for your help with this, but I'm going to put it on hold for now. Hopefully it'll work for me in 18.03.

@svsdep
Copy link
Contributor

svsdep commented Feb 21, 2018

Works just fine with the latest unstable and a following config:

environment.systemPackages = with pkgs; [
  firefox
  chrome-gnome-shell
];

nixpkgs.config.firefox.enableGnomeExtensions = true;

@neilmayhew neilmayhew changed the title chrome-gnome-shell doesn't work chrome-gnome-shell doesn't work in 17.09 Feb 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: question 6.topic: GNOME GNOME desktop environment and its underlying platform
Projects
None yet
Development

No branches or pull requests

4 participants