Home Explore Blog CI



nixpkgs

3rd chunk of `nixos/modules/services/desktop-managers/gnome.md`
12d9ab20d98083388fce6cc20f8c0492eb59d9ffcf948f4e0000000100000cc4
You can install them like any other package:

```nix
{
  environment.systemPackages = [
    gnomeExtensions.dash-to-dock
    gnomeExtensions.gsconnect
    gnomeExtensions.mpris-indicator-button
  ];
}
```

Unfortunately, we lack a way for these to be managed in a completely declarative way.
So you have to enable them manually with an Extensions application.
It is possible to use a [GSettings override](#sec-gnome-gsettings-overrides) for this on `org.gnome.shell.enabled-extensions`, but that will only influence the default value.

## GSettings Overrides {#sec-gnome-gsettings-overrides}

Majority of software building on the GNOME platform use GLib’s [GSettings](https://developer.gnome.org/gio/unstable/GSettings.html) system to manage runtime configuration. For our purposes, the system consists of XML schemas describing the individual configuration options, stored in the package, and a settings backend, where the values of the settings are stored. On NixOS, like on most Linux distributions, dconf database is used as the backend.

[GSettings vendor overrides](https://developer.gnome.org/gio/unstable/GSettings.html#id-1.4.19.2.9.25) can be used to adjust the default values for settings of the GNOME desktop and apps by replacing the default values specified in the XML schemas. Using overrides will allow you to pre-seed user settings before you even start the session.

::: {.warning}
Overrides really only change the default values for GSettings keys so if you or an application changes the setting value, the value set by the override will be ignored. Until [NixOS’s dconf module implements changing values](https://github.com/NixOS/nixpkgs/issues/54150), you will either need to keep that in mind and clear the setting from the backend using `dconf reset` command when that happens, or use the [module from home-manager](https://nix-community.github.io/home-manager/options.html#opt-dconf.settings).
:::

You can override the default GSettings values using the
[](#opt-services.desktopManager.gnome.extraGSettingsOverrides) option.

Take note that whatever packages you want to override GSettings for, you need to add them to
[](#opt-services.desktopManager.gnome.extraGSettingsOverridePackages).

You can use `dconf-editor` tool to explore which GSettings you can set.

### Example {#sec-gnome-gsettings-overrides-example}

```nix
{
  services.desktopManager.gnome = {
    extraGSettingsOverrides = ''
      # Change default background
      [org.gnome.desktop.background]
      picture-uri='file://${pkgs.nixos-artwork.wallpapers.mosaic-blue.gnomeFilePath}'

      # Favorite apps in gnome-shell
      [org.gnome.shell]
      favorite-apps=['org.gnome.Console.desktop', 'org.gnome.Nautilus.desktop']
    '';

    extraGSettingsOverridePackages = [
      pkgs.gsettings-desktop-schemas # for org.gnome.desktop
      pkgs.gnome-shell # for org.gnome.shell
    ];
  };
}
```

## Frequently Asked Questions {#sec-gnome-faq}

### Can I use LightDM with GNOME? {#sec-gnome-faq-can-i-use-lightdm-with-gnome}

Yes you can, and any other display-manager in NixOS.

However, it doesn’t work correctly for the Wayland session of GNOME Shell yet, and
won’t be able to lock your screen.

See [this issue.](https://github.com/NixOS/nixpkgs/issues/56342)

Title: GNOME Extensions, GSettings Overrides, and FAQs
Summary
This section explains how to install GNOME Shell extensions and manage them manually due to the lack of declarative management. It details how to use GSettings overrides to adjust default settings for GNOME desktop and applications. It warns that overrides only change default values and recommends using `dconf reset` or home-manager for persistent changes. An example is provided to demonstrate how to override GSettings for background and favorite apps. Finally, it addresses the question of using LightDM with GNOME, noting issues with Wayland and screen locking.