Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: add declarative gnome extensions management using dconf #365427

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 72 additions & 7 deletions nixos/modules/services/x11/desktop-managers/gnome.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,17 +120,82 @@ You can install them like any other package:

```nix
{
environment.systemPackages = [
gnomeExtensions.dash-to-dock
gnomeExtensions.gsconnect
gnomeExtensions.mpris-indicator-button
environment.systemPackages = with pkgs.gnomeExtensions; [
dash-to-dock
gsconnect
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.
Enable them with the `dconf` module:

```nix
programs.dconf = {
enable = true;
profiles.user.databases = [{
settings = with lib.gvariant; {
"org/gnome/shell" = {
enabled-extensions = [
pkgs.gnomeExtensions.dash-to-dock.extensionUuid
pkgs.gnomeExtensions.gsconnect.extensionUuid
pkgs.gnomeExtensions.mpris-indicator-button.extensionUuid
];
};
};
}];
}
```

Here's an example to install and enable all your Gnome extensions dynamically:

```nix
{ pkgs, lib, ... }:

let
# all gnome extensions to install and enable
extensions = with pkgs.gnomeExtensions; [
dask-to-dock
blur-my-shell
];
in
{
environment.systemPackages = extensions;

programs.dconf = {
enable = true;
profiles.user.databases = [{
settings = with lib.gvariant; {
"org/gnome/shell" = {
enabled-extensions =
builtins.map
(x: x.extensionUuid)
(lib.filter (p: p ? extensionUuid) extensions);
};
};
}];
};
}
```

Editing your extensions' settings can be done through `dconf`:
```nix
programs.dconf = {
enable = true;
profiles.user.databases = [{
settings = with lib.gvariant; {
"org/gnome/shell/extensions/system-monitor" = {
disk-display = true;
disk-graph-width = graphWidth;
};
};
}];
}
```

::: {.tip}
If your extensions aren't enabled after a `nixos-rebuild switch`, run `dconf reset /org/gnome/shell/disabled-extensions` and `dconf reset /org/gnome/shell/enabled-extensions`, to make sure `dconf` follows what's in your config.
:::

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

Expand Down
Loading