GNOME: Difference between revisions
→Tips and tricks: Add section for Qt integration with GNOME |
m →Discover dconf settings: Use code font instead of erroneous backticks. |
||
(13 intermediate revisions by 3 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| | {{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; | ||
} | |||
# 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 26: | Line 35: | ||
GNOME offers support for changing/overhauling the user interface (GNOME Shell) through the use of ''[https://extensions.gnome.org/about/ Extensions].'' Extensions are bundles of third-party [https://gjs.guide/extensions/ 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 [https://extensions.gnome.org/ webpage] and can be installed imperatively if needed by unpacking the extension in <code>~/.local/share/gnome-shell/extensions</code> directory. Extensions can only be activated if it supports the GNOME release that it's installed alongside with. | GNOME offers support for changing/overhauling the user interface (GNOME Shell) through the use of ''[https://extensions.gnome.org/about/ Extensions].'' Extensions are bundles of third-party [https://gjs.guide/extensions/ 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 [https://extensions.gnome.org/ webpage] and can be installed imperatively if needed by unpacking the extension in <code>~/.local/share/gnome-shell/extensions</code> directory. Extensions can only be activated if it supports the GNOME release that it's installed alongside with. | ||
In addition, NixOS automatically packages all officially available GNOME extensions under the <code>pkgs.gnomeExtensions</code> 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 <code>gnome-extensions</code> command line interface. | |||
{{file|3={ | {{file|3={ | ||
Line 75: | Line 84: | ||
}; | }; | ||
}; | }; | ||
}|name=~/.config/home-manager/home.nix|lang=nix}}Thus the settings attribute accepts an attribute set whose keys are schemas with each schema's value being a nested attribute set of the schema's keys with their appropriate GVariant value.{{Note|Schemas in Nix are written without leading and trailing slashes. In addition, since dconf have more data types than the Nix language (for example, tuples), in some cases you'll need to convert Nix value to a GVariant value. You can achieve that by using the functions defined under <code>lib.gvariant</code>, they're documented [https://nixos.org/manual/nixpkgs/stable/#sec-functions-library-gvariant here].}} | }|name=~/.config/home-manager/home.nix|lang=nix}}Thus the settings attribute accepts an attribute set whose keys are schemas with each schema's value being a nested attribute set of the schema's keys with their appropriate GVariant value.{{Note|Schemas in Nix are written without leading and trailing slashes. In addition, since dconf have more data types than the Nix language (for example, tuples), in some cases you'll need to convert Nix value to a GVariant value. You can achieve that by using the functions defined under <code>lib.gvariant</code>, they're documented [https://nixos.org/manual/nixpkgs/stable/#sec-functions-library-gvariant here].}}If you wish to revert all dconf settings back to their default state (reset GNOME essentially) then use the following command which resets all schemas directories available on your system, note that this will affect all programs that use dconf, including GNOME apps and extensions.<syntaxhighlight lang="bash"> | ||
$ dconf reset -f / | |||
</syntaxhighlight> | |||
==== Extensions ==== | ==== Extensions ==== | ||
Line 118: | Line 129: | ||
=== GNOME Qt integration === | === GNOME Qt integration === | ||
Using the following example configuration, | Using the following example configuration, Qt applications will have a look similar to the adwaita style used by GNOME using a dark theme. | ||
{{File|3={ | {{File|3={ | ||
qt = { | qt = { | ||
Line 160: | 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 | 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 228: | Line 239: | ||
=== 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 276: | Line 287: | ||
}|name=/etc/nixos/configuration.nix|lang=nix}} | }|name=/etc/nixos/configuration.nix|lang=nix}} | ||
: | : | ||
== | == References == | ||
[[Category:Desktop environment]] | [[Category:Desktop environment]] | ||
[[Category:Applications]] | [[Category:Applications]] | ||
[[Category:NixOS Manual]] | [[Category:NixOS Manual]] | ||
[[Category:GNOME]] | [[Category:GNOME]] |