Home-manager: GNOME Shell extensions support

Created on 5 Jun 2018  ·  7Comments  ·  Source: nix-community/home-manager

It would be awesome if home-manager would be able to change GNOME Shell configuration. I believe that extensions would be a good place to start, as they simply are directories under ~/.local/share/gnome-shell/extensions.

Most helpful comment

The following example works for me. You can also replace fetchGit with fetchTarball or something for stable versions.

{ pkgs, ... }: {
  home.file.".local/share/gnome-shell/extensions/[email protected]".source = builtins.fetchGit {
    url = "https://github.com/rliang/gnome-shell-extension-tilingnome.git";
  };
  dconf = {
    enable = true;
    settings = {
      "org/gnome/shell".enabled-extensions = ["[email protected]"];
    };
  };
}

All 7 comments

Yeah, that would indeed be awesome! 🙂 Right now Home Manager is only able to configure GNOME Terminal (through the dconf command line tool) which has been working quite well for me.

I'm not using GNOME Shell, though so I can't really work on this module myself but I would be happy to assist.

For the specific case of extensions it does indeed seem pretty straight forward from what I can tell, just to put the unzipped extension directories in the right place and enable the extensions through dconf.

@rycee , that's exactly what I though about :+1: Right now I'm trying to understand how to write home-manager modules and it seems pretty straight-forward. Tomorrow I'll try to implement a first version.

Actually, after some research it appears to me that it would be nicer if we would use the already-existant DBUS interface for installing extensions (org/gnome/Shell org.gnome.Shell.Extensions). There are InstallRemoteExtension(string uuid), ListExtensions() methods. Although there is a caveat: InstallRemoteExtension requires user interaction (it shows a dialog asking user if he wants ti download and install extension). It would be a nuissance to install all extensions every time, so I think first we should ListExtensions and figure out what exactly we need to install&enable and what we need to disable. Although I don't quite know of any way to do that.
Another option is, as @rycee already mentioned, is to just fetch tarballs manually, then link them to ~/.local/share/gnome-shell/extensions and enable them with dconf.
In short: should I use DBUS or fetchTarball for installing extensions?

To download extensions at activation time is not really an option, mostly because it reduces atomicity (i.e., we cannot guarantee that activating a generation twice will install the exact same extension binary). We also cannot guarantee that there actually is networking available.

Neither is doing graphical prompts since the activation may happen when no graphical interface is available, for example when using the Home Manager NixOS module. Unfortunately, at the moment dconf doesn't work when using the NixOS module because the session dbus is not available but at least this should be a solvable problem.

So yeah, the extensions should be downloaded using a fetch command and put into place by Home Manager.

Thank you for the explanation. I am currently working on the module.

чт, 7 июн. 2018 г. в 21:18, Robert Helgesson notifications@github.com:

To download extensions at activation time is not really an option, mostly
because it reduces atomicity (i.e., we cannot guarantee that activating a
generation twice will install the exact same extension binary). We also
cannot guarantee that there actually is networking available.

Neither is doing graphical prompts since the activation may happen when no
graphical interface is available, for example when using the Home Manager
NixOS module. Unfortunately, at the moment dconf doesn't work when using
the NixOS module because the session dbus is not available but at least
this should be a solvable problem.

So yeah, the extensions should be downloaded using a fetch command and
put into place by Home Manager.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/rycee/home-manager/issues/284#issuecomment-395516626,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ARnLU204IVm2ksH9dX7g66CzPImWlnNvks5t6W6AgaJpZM4Ua-wB
.

>

С уважением,
ученик МБОУ "Гимназия №2 "Квантор"

Бантьев Александр balsoft@yandex.ru balsoft75@gmail.com

Best regards,
Alexander Bantyev aka balsoft balsoft@yandex.ru balsoft75@gmail.com

The following example works for me. You can also replace fetchGit with fetchTarball or something for stable versions.

{ pkgs, ... }: {
  home.file.".local/share/gnome-shell/extensions/[email protected]".source = builtins.fetchGit {
    url = "https://github.com/rliang/gnome-shell-extension-tilingnome.git";
  };
  dconf = {
    enable = true;
    settings = {
      "org/gnome/shell".enabled-extensions = ["[email protected]"];
    };
  };
}

If the extension is in nixpkgs you can also do this:

{ pkgs, ... }:
{
  dconf.settings."org/gnome/shell".enabled-extensions = [
    pkgs.gnomeExtensions.clipboard-indicator.uuid
    pkgs.gnomeExtensions.system-monitor.uuid
  ];
}
Was this page helpful?
0 / 5 - 0 ratings

Related issues

rschulman picture rschulman  ·  5Comments

mightybyte picture mightybyte  ·  5Comments

btomasini picture btomasini  ·  4Comments

pmiddend picture pmiddend  ·  3Comments

loewenheim picture loewenheim  ·  7Comments