go-musicfox: 4.5.7 -> 4.6.0 (#364326)
[NixPkgs.git] / nixos / modules / services / desktops / gnome / gnome-browser-connector.nix
blob335ebc9a144d3f5a745b4605b087b484669a6149
2   config,
3   lib,
4   pkgs,
5   ...
6 }:
8 let
9   inherit (lib)
10     mkEnableOption
11     mkIf
12     mkRenamedOptionModule
13     teams
14     ;
18   meta = {
19     maintainers = teams.gnome.members;
20   };
22   options = {
23     services.gnome.gnome-browser-connector.enable = mkEnableOption ''
24       native host connector for the GNOME Shell browser extension, a DBus service
25       allowing to install GNOME Shell extensions from a web browser
26     '';
27   };
29   config = mkIf config.services.gnome.gnome-browser-connector.enable {
30     environment.etc = {
31       "chromium/native-messaging-hosts/org.gnome.browser_connector.json".source =
32         "${pkgs.gnome-browser-connector}/etc/chromium/native-messaging-hosts/org.gnome.browser_connector.json";
33       "opt/chrome/native-messaging-hosts/org.gnome.browser_connector.json".source =
34         "${pkgs.gnome-browser-connector}/etc/opt/chrome/native-messaging-hosts/org.gnome.browser_connector.json";
35       # Legacy paths.
36       "chromium/native-messaging-hosts/org.gnome.chrome_gnome_shell.json".source =
37         "${pkgs.gnome-browser-connector}/etc/chromium/native-messaging-hosts/org.gnome.chrome_gnome_shell.json";
38       "opt/chrome/native-messaging-hosts/org.gnome.chrome_gnome_shell.json".source =
39         "${pkgs.gnome-browser-connector}/etc/opt/chrome/native-messaging-hosts/org.gnome.chrome_gnome_shell.json";
40     };
42     environment.systemPackages = [ pkgs.gnome-browser-connector ];
44     services.dbus.packages = [ pkgs.gnome-browser-connector ];
46     programs.firefox.nativeMessagingHosts.packages = [ pkgs.gnome-browser-connector ];
47   };