{ pkgs, lib, config, ... }: let cfg = config._archetypes.collections.desktop.xserver; in { options._archetypes.collections.desktop.xserver = { enable = lib.mkEnableOption "installs xserver"; utilities.enable = lib.mkEnableOption "installs basic xserver utilities"; }; config = lib.mkIf cfg.enable { services.xserver.enable = true; services.xserver.displayManager.startx.enable = true; services.libinput.enable = true; # Enable touchpad support # Install basic X utilities environment.systemPackages = with pkgs; lib.optionals cfg.utilities.enable [ unclutter xcape xclip xdotool xorg.setxkbmap xorg.xinput xorg.xkill xorg.xrandr xorg.xset xwallpaper ]; # Enable TearFree option by default # Not all video drivers support this option services.xserver.deviceSection = '' Option "TearFree" "true" ''; }; }