{ pkgs, lib, config, ... }: { options = { xserver.enable = lib.mkEnableOption "enables xserver"; }; config = lib.mkIf config.xserver.enable { services.xserver.enable = true; services.xserver.displayManager.startx.enable = true; services.libinput.enable = true; # Enable touchpad support environment.systemPackages = with pkgs; [ unclutter xcape xclip xdotool xorg.setxkbmap xorg.xinput xorg.xkill xorg.xrandr xorg.xset xwallpaper # Patch startx to be compliant with xdg base dir spec (xorg.xinit.overrideAttrs (old: rec { patches = [ ./resources/x11/xinit-startx-xdg.patch ]; })) ]; }; }