diff --git a/nixos/modules/services/misc/graphical-desktop.nix b/nixos/modules/services/misc/graphical-desktop.nix index 246310195edc..0b5ef033e38b 100644 --- a/nixos/modules/services/misc/graphical-desktop.nix +++ b/nixos/modules/services/misc/graphical-desktop.nix @@ -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.