Unverified Commit 57507a52 authored by Sandro Jäckel's avatar Sandro Jäckel
Browse files

nixos/graphical-desktop: add enable option

parent 1fc12028
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -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.