{ lib, pkgs, config, ...}: let inherit (lib) mkIf mkEnableOption mkOption; cfg = config.chuj.stuff.xserver; in { options.chuj.stuff.xserver = { enable = mkEnableOption "xserver"; libinput = mkEnableOption "libinput"; }; config = mkIf cfg.enable { services = { xserver = { enable = true; xkb.layout = "pl"; # autoRepeatDelay = 180; # autoRepeatInterval = 50; # fixme: ^ this doesn't work displayManager.sessionCommands = '' ${lib.getExe pkgs.xorg.xset} r rate 180 50 ''; enableTearFree = true; }; }; environment.systemPackages = with pkgs; [ xclip xorg.xkill xorg.xev xdotool ]; services.libinput = if cfg.libinput then { enable = true; touchpad = { naturalScrolling = false; # it's reversed on my laptop for some reason tapping = true; tappingButtonMap = "lmr"; scrollMethod = "edge"; }; } else { enable = lib.mkForce false; }; # fuck you }; }