GNOME: Difference between revisions
→Installation: Move extension installation information out of configuration. |
m →See also: Explain citation |
||
Line 1: | Line 1: | ||
[[{{PAGENAME}}]] (/(ɡ)noʊm/) is a [[:Category:Desktop environment|desktop environment]] for both [[Wayland]] and [[Xorg]] that seeks to be "an independent computing platform for everyone."<ref> | [[{{PAGENAME}}]] (/(ɡ)noʊm/) is a [[:Category:Desktop environment|desktop environment]] for both [[Wayland]] and [[Xorg]] that seeks to be "an independent computing platform for everyone."<ref>Official GNOME Project one-liner https://www.gnome.org/ </ref> | ||
This article is an extension of the documentation in the [https://nixos.org/manual/nixos/stable/#chap-gnome NixOS manual]. | This article is an extension of the documentation in the [https://nixos.org/manual/nixos/stable/#chap-gnome NixOS manual]. |
Revision as of 05:40, 8 June 2025
GNOME (/(ɡ)noʊm/) is a desktop environment for both Wayland and Xorg that seeks to be "an independent computing platform for everyone."[1]
This article is an extension of the documentation in the NixOS manual.
Installation
To use GNOME on NixOS, the following configuration options must be set:
{
# Pre 25.11
services.xserver.enable = true;
services.xserver.displayManager.gdm.enable = true;
services.xserver.desktopManager.gnome.enable = true;
# As of 25.11
services.displayManager.gdm.enable = true;
services.desktopManager.gnome.enable = true;
}
Despite the options in NixOS versions before 25.11 being under the xserver
namespace, GNOME runs offers Wayland by default. 25.11 and later versions remove support for the Xorg session entirely (though Xwayland is still included and supported for compatibility).
GNOME Extensions
GNOME offers support for changing/overhauling the user interface (GNOME Shell) through the use of Extensions. Extensions are bundles of third-party GJS modules that are loaded while GNOME is running to augment the user experience. A repository of GNOME extensions can be found on GNOME's official webpage and can be installed imperatively if needed by unpacking the extension in ~/.local/share/gnome-shell/extensions
directory. Extensions can only be activated if it supports the GNOME release that it's installed alongside with.
However, Nix automatically packages all available GNOME extensions under the pkgs.gnomeExtensions
attribute. Extensions which require additional dependencies are then manually packaged if needed. Installed extensions can be enabled graphically through the built-in "Extensions" application or through the gnome-extensions
command line interface.
{
environment.systemPackages = with pkgs; [
gnomeExtensions.blur-my-shell
gnomeExtensions.just-perfection
gnomeExtensions.arc-menu
];
}
Excluding GNOME Applications
To exclude certain applications that are installed by default with GNOME edit configuration.nix
as follows:
{
environment.gnome.excludePackages = with pkgs; [
orca
evince
file-roller
geary
gnome-disk-utility
# seahorse
# sushi
# sysprof
#
# gnome-shell-extensions
#
# adwaita-icon-theme
# nixos-background-info
gnome-backgrounds
# gnome-bluetooth
# gnome-color-manager
# gnome-control-center
# gnome-shell-extensions
gnome-tour # GNOME Shell detects the .desktop file on first log-in.
gnome-user-docs
# glib # for gsettings program
# gnome-menus
# gtk3.out # for gtk-launch program
# xdg-user-dirs # Update user dirs as described in https://freedesktop.org/wiki/Software/xdg-user-dirs/
# xdg-user-dirs-gtk # Used to create the default bookmarks
#
baobab
epiphany
gnome-text-editor
gnome-calculator
gnome-calendar
gnome-characters
# gnome-clocks
gnome-console
gnome-contacts
gnome-font-viewer
gnome-logs
gnome-maps
gnome-music
# gnome-system-monitor
gnome-weather
# loupe
# nautilus
gnome-connections
simple-scan
snapshot
totem
yelp
gnome-software
];
}
Configuration
Managing extensions
Installed extensions can be enabled and configured in Extension app that comes preinstalled with GNOME. If you want to do that declaratively in your configuration, you can use Home Manager dconf
module by adding following lines.
{
dconf = {
enable = true;
settings = {
"org/gnome/shell" = {
disable-user-extensions = false; # enables user extensions
enabled-extensions = [
# Put UUIDs of extensions that you want to enable here.
# If the extension you want to enable is packaged in nixpkgs,
# you can easily get its UUID by accessing its extensionUuid
# field (look at the following example).
pkgs.gnomeExtensions.gsconnect.extensionUuid
# Alternatively, you can manually pass UUID as a string.
"blur-my-shell@aunetx"
# ...
];
};
# Configure individual extensions
"org/gnome/shell/extensions/blur-my-shell" = {
brightness = 0.75;
noise-amount = 0;
};
};
};
}
dconf settings
Most of the GNOME settings are stored in dconf database. Settings are stored as keys placed in folders.
To learn about settings that can be configured with dconf either look into dconf-editor
program (provided by gnome.dconf-editor
package) or type dconf watch /
in the terminal and change settings from the GUI and see which options are responsible for that component/element.
These settings can be changed by NixOS via programs.dconf
module or by Home Manager via dconf
module. To so in Home Manager, you need to change dconf.settings
attribute set. This attribute set contains absolute folder paths (without leading slash) as attributes' names which value is another attribute set with keys (settings).
For example, to change the value of clock-show-weekday
key that is located in /org/gnome/desktop/interface
, you need to the following:
{
dconf = {
enable = true;
settings = {
# You need quotes to escape '/'
"org/gnome/desktop/interface" = {
clock-show-weekday = true;
};
};
};
}
Same can be achieved by using system configuration.
{
programs.dconf = {
enable = true;
profiles.user.databases = [
{
lockAll = true; # prevents overriding
settings = {
"org/gnome/desktop/interface" = {
clock-show-weekday = true;
};
};
}
];
};
}
lib.gvariant
, they're documented here.Tips and tricks
To run GNOME programs outside of GNOME
GNOME platform-based applications are largely self-contained, but they still depend, for one reason or another, on some global configuration. The gnome.nix
module sets all the necessary options for you but if you are running customized set-up, you might need to replicate that yourself.
For instance, if you see the following error:
dconf-WARNING **: failed to commit changes to dconf: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name ca.desrt.dconf was not provided by any .service files
you should enable dconf module:
{
programs.dconf.enable = true;
}
If you're using the default theme, GTK-3 applications may not respect the dark theme if they can't find the Adwaita. To fix it, make sure you have the gnome-themes-extra
package installed:
{
environment.systemPackages = [ pkgs.gnome-themes-extra ];
}
Systray Icons
To get systray icons, install the related GNOME shell extension
{
environment.systemPackages = [ pkgs.gnomeExtensions.appindicator ];
}
And ensure gnome-settings-daemon udev rules are enabled:
{
services.udev.packages = [ pkgs.gnome-settings-daemon ];
}
To run old applications
Some old applications use GConf service to store configuration. This has been deprecated for many years but some applications were abandoned before they managed to upgrade to a newer dconf system. If you are running such application and getting an error like:
GLib.GException: Failed to contact configuration server; the most common cause is a missing or misconfigured D-Bus session bus daemon. See http://projects.gnome.org/gconf/ for information
you need to add gnome2.GConf
to the list of dbus packages in your configuration.nix
:
{
services.dbus.packages = with pkgs; [ gnome2.GConf ];
}
After applying the update restart your desktop session to refresh the user-specific dbus session.
Profiling (with sysprof)
Install sysprof
as a system package (it won't work properly if installed against users). Then enable the associated service with
services.sysprof.enable = true;
Automatic screen rotation
hardware.sensor.iio.enable = true;
Dark mode
Change default color theme for all GTK4 applications to dark using Home Manager.
{
dconf = {
enable = true;
settings."org/gnome/desktop/interface".color-scheme = "prefer-dark";
};
}
Troubleshoots
Automatic login
If you have enabled auto login (with GNOME) with something like
$ grep autoLogin /etc/nixos/configuration.nix
services.xserver.displayManager.autoLogin.enable = true;
services.xserver.displayManager.autoLogin.user = "account";
than add the following (as a workaround for a current (2023)[2] problem)
# nano /etc/nixos/configuration.nix
{
systemd.services."getty@tty1".enable = false;
systemd.services."autovt@tty1".enable = false;
}
See also
- ↑ Official GNOME Project one-liner https://www.gnome.org/
- ↑ https://github.com/NixOS/nixpkgs/issues/103746#issuecomment-945091229