nixos/graphical-desktop: add enable option

This commit is contained in:
Sandro Jäckel 2024-08-16 15:09:49 +02:00
parent 1fc12028b7
commit 57507a521a
No known key found for this signature in database
GPG Key ID: 3AF5A43A3EECC2E5

View File

@ -5,11 +5,22 @@
...
}:
let
cfg = config.services.graphical-desktop;
xcfg = config.services.xserver;
dmcfg = config.services.displayManager;
in
{
config = lib.mkIf (xcfg.enable || dmcfg.enable) {
options = {
services.graphical-desktop.enable =
lib.mkEnableOption "bits and pieces required for a graphical desktop session"
// {
default = xcfg.enable || dmcfg.enable;
defaultText = lib.literalExpression "(config.services.xserver.enable || config.services.displayManager.enable)";
internal = true;
};
};
config = lib.mkIf cfg.enable {
# The default max inotify watches is 8192.
# Nowadays most apps require a good number of inotify watches,
# the value below is used by default on several other distros.