Enabling GNOME extensions with home manager

I have this in my home.nix file:

dconf.settings = {
    "org/gnome/desktop/background" = {
      color-shading-type = "solid";
      picture-uri = "file:///run/current-system/sw/share/backgrounds/Photo%20of%20Valley.jpg";
      picture-uri-dark = "file:///run/current-system/sw/share/backgrounds/Photo%20of%20Valley.jpg";
      };
      "org/gnome/shell" = {
        enabled-extensions =
          "['dash-to-dock@micxgx.gmail.com', 'show-desktop-button@amivaleo', 'user-theme@gnome-shell-extensions.gcampax.github.com']";
        };
  };

But oddly rebuilding my system config (which references my home.nix file) leads to all extensions being disabled. gnomeExtensions.dash-to-dock and gnomeExtensions.show-desktop-button are listed in systemPackages. What have I done wrong?

try following (thats how I have done it for gnome)

  home.packages = with pkgs; [
    #gnomeExtensions.pop-shell
    gnomeExtensions.forge 
    gnomeExtensions.blur-my-shell
    gnomeExtensions.vitals
    gnomeExtensions.gsconnect
    gnomeExtensions.quick-settings-tweaker
    gnomeExtensions.paperwm
  ];        
  dconf = {
    enable = true;
    settings = {
      "org/gnome/shell" = {
        # `gnome-extensions list` for a list
        enabled-extensions = [
          #pkgs.gnomeExtensions.pop-shell  
          #"pop-shell@system76.com"
          "forge@jmmaranan.com"          
          "blur-my-shell@aunetx"
          "Vitals@CoreCoding.com"
          "gsconnect@andyholmes.github.io"
          "quick-settings-tweaks@qwreey"
          "paperwm@paperwm.github.com"
          #"just-perfection-desktop@just-perfection"
        ];
      };
      "org/gnome/desktop/interface".show-battery-percentage = true;
    };
  };

This approach to extension package management didn’t work for me. I opened up the extension manager and it said that the show desktop button and dash to dock extension didn’t load as /run/current-system/sw/share/gnome-shell/extensions didn’t contain the extensions and this was causing their loading to error. I found a solution though. I had to add the extensions to my systemPackages instead and with that tweak to your code, they load fine. Thanks.

1 Like