GNOME: Difference between revisions

Jasi (talk | contribs)
GNOME extensions: Improve word choice.
Jasi (talk | contribs)
Enable system tray icons: Remove configuration line for udev as gnome-settings-daemon is already added in the desktop module.
(11 intermediate revisions by 4 users not shown)
Line 8: Line 8:
To use the GNOME desktop environment on NixOS, the following configuration options must be set:
To use the GNOME desktop environment on NixOS, the following configuration options must be set:


{{file|/etc/nixos/configuration.nix|nix|<nowiki>
{{file|3={ config, pkgs, ... }:
 
{
{
   # Pre 25.11
   # Pre 25.11
   services.xserver.enable = true;
   services.xserver.enable = true;
Line 18: Line 20:
   services.displayManager.gdm.enable = true;
   services.displayManager.gdm.enable = true;
   services.desktopManager.gnome.enable = true;
   services.desktopManager.gnome.enable = true;
}
 
</nowiki>}}
  # To disable installing GNOME's suite of applications
  # and only be left with GNOME shell.
  services.gnome.core-apps.enable = false;
  services.gnome.core-developer-tools.enable = false;
  services.gnome.games.enable = false;
  environment.gnome.excludePackages = with pkgs; [ gnome-tour gnome-user-docs ];
 
}|name=/etc/nixos/configuration.nix|lang=nix}}


Despite the options in NixOS versions before 25.11 being under the <code>xserver</code> module, GNOME uses [[Wayland]] by default. NixOS 25.11 and later removes support for the [[Xorg]] session entirely (though Xwayland is still included and supported for compatibility).
Despite the options in NixOS versions before 25.11 being under the <code>xserver</code> module, GNOME uses [[Wayland]] by default. NixOS 25.11 and later removes support for the [[Xorg]] session entirely (though Xwayland is still included and supported for compatibility).
Line 162: Line 171:


=== Discover dconf settings ===
=== Discover dconf settings ===
If you wish to discover the corresponding dconf entry for a given setting in a program, you can run `dconf watch /` inside of a terminal and change the setting graphically. For example, when changing toggling the Quick-Settings option "Dark Style" from "on" to "off" and back to "on," this will be the output:<syntaxhighlight lang="shell-session">
If you wish to discover the corresponding dconf entry for a given setting in a program, you can run <code>dconf watch /</code> inside of a terminal and change the setting graphically. For example, when changing toggling the Quick-Settings option "Dark Style" from "on" to "off" and back to "on," this will be the output:<syntaxhighlight lang="shell-session">
$ dconf watch /
$ dconf watch /
/org/gnome/desktop/interface/color-scheme
/org/gnome/desktop/interface/color-scheme
Line 197: Line 206:
GNOME does not currently support system tray icons. However, Ubuntu has created an [https://extensions.gnome.org/extension/615/appindicator-support/ extension] that implements this in the top bar. You can install this extension with the following in NixOS:
GNOME does not currently support system tray icons. However, Ubuntu has created an [https://extensions.gnome.org/extension/615/appindicator-support/ extension] that implements this in the top bar. You can install this extension with the following in NixOS:
{{File|3={
{{File|3={
   environment.systemPackages = [ pkgs.gnomeExtensions.appindicator ];
   environment.systemPackages = [ pkgs.gnomeExtensions.appindicator ];
  services.udev.packages = [ pkgs.gnome-settings-daemon ];
}|name=/etc/nixos/configuration.nix|lang=nix}}You can also install the extension outside of Nix and it will function the same.
}|name=/etc/nixos/configuration.nix|lang=nix}}


=== Profiling (with sysprof) ===
=== Profiling (with sysprof) ===
Line 230: Line 238:
=== Excluding GNOME Applications ===
=== Excluding GNOME Applications ===


To exclude certain applications that are installed by default with GNOME, set the {{nixos:option|environment.gnome.excludePackages}} module option:
To exclude certain applications that are installed by default with GNOME, set the {{nixos:option|environment.gnome.excludePackages}} module option (Optional Packages: [https://github.com/NixOS/nixpkgs/blob/nixos-unstable/nixos/modules/services/desktop-managers/gnome.nix#L449-L471 gnome.nix]):


{{file|/etc/nixos/configuration.nix|nix|<nowiki>
{{file|/etc/nixos/configuration.nix|nix|<nowiki>
Line 263: Line 271:
=== Automatic login ===
=== Automatic login ===


As a potential workaround<ref>https://github.com/NixOS/nixpkgs/issues/103746#issuecomment-945091229</ref> for automatic login, include this in your NixOS configuration:
For automatic login, include this in your NixOS configuration adjusting the "<your username>" part with your username:


{{File|3={
{{File|3={
   services.xserver.displayManager.autoLogin.enable = true;
   services.displayManager.autoLogin.enable = true;
   services.xserver.displayManager.autoLogin.user = "account";
   services.displayManager.autoLogin.user = "<your username>";
 
  systemd.services."getty@tty1".enable = false;
  systemd.services."autovt@tty1".enable = false;
}|name=/etc/nixos/configuration.nix|lang=nix}}
}|name=/etc/nixos/configuration.nix|lang=nix}}


Line 278: Line 283:
}|name=/etc/nixos/configuration.nix|lang=nix}}
}|name=/etc/nixos/configuration.nix|lang=nix}}
:
:
== See also ==
== References ==
* [[GNOME/Calendar]]
 
[[Category:Desktop environment]]
[[Category:Desktop environment]]
[[Category:Applications]]
[[Category:Applications]]
[[Category:NixOS Manual]]
[[Category:NixOS Manual]]
[[Category:GNOME]]
[[Category:GNOME]]