From 57507a521a6ed57ec0161a2ec03f9d131bda2115 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Fri, 16 Aug 2024 15:09:49 +0200 Subject: [PATCH] nixos/graphical-desktop: add enable option --- nixos/modules/services/misc/graphical-desktop.nix | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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.