summary refs log tree commit diff
path: root/nixos/modules/services/desktops/gnome/chrome-gnome-shell.nix
blob: 15c5bfbd82109973b02434e256b1f42d50d27f05 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# Chrome GNOME Shell native host connector.
{ config, lib, pkgs, ... }:

with lib;

{
  meta = {
    maintainers = teams.gnome.members;
  };

  # Added 2021-05-07
  imports = [
    (mkRenamedOptionModule
      [ "services" "gnome3" "chrome-gnome-shell" "enable" ]
      [ "services" "gnome" "chrome-gnome-shell" "enable" ]
    )
  ];

  ###### interface
  options = {
    services.gnome.chrome-gnome-shell.enable = mkEnableOption ''
      Chrome GNOME Shell native host connector, a DBus service
      allowing to install GNOME Shell extensions from a web browser.
    '';
  };


  ###### implementation
  config = mkIf config.services.gnome.chrome-gnome-shell.enable {
    environment.etc = {
      "chromium/native-messaging-hosts/org.gnome.chrome_gnome_shell.json".source = "${pkgs.chrome-gnome-shell}/etc/chromium/native-messaging-hosts/org.gnome.chrome_gnome_shell.json";
      "opt/chrome/native-messaging-hosts/org.gnome.chrome_gnome_shell.json".source = "${pkgs.chrome-gnome-shell}/etc/opt/chrome/native-messaging-hosts/org.gnome.chrome_gnome_shell.json";
    };

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

    services.dbus.packages = [ pkgs.chrome-gnome-shell ];

    nixpkgs.config.firefox.enableGnomeExtensions = true;
  };
}