2024-08-01 21:22:47 +02:00
|
|
|
{ lib, pkgs, config, ...}: let
|
|
|
|
inherit (lib) mkIf mkEnableOption mkOption;
|
|
|
|
cfg = config.chuj.stuff.xserver;
|
|
|
|
in {
|
|
|
|
options.chuj.stuff.xserver = {
|
|
|
|
enable = mkEnableOption "xserver";
|
2024-08-02 00:10:45 +02:00
|
|
|
libinput = mkEnableOption "libinput";
|
2024-08-01 21:22:47 +02:00
|
|
|
};
|
2024-10-16 11:40:24 +02:00
|
|
|
|
2024-08-01 21:22:47 +02:00
|
|
|
config = mkIf cfg.enable {
|
|
|
|
services = {
|
|
|
|
xserver = {
|
|
|
|
enable = true;
|
|
|
|
xkb.layout = "pl";
|
|
|
|
# autoRepeatDelay = 180;
|
|
|
|
# autoRepeatInterval = 50;
|
2024-10-16 11:40:24 +02:00
|
|
|
# fixme: ^ this doesn't work
|
|
|
|
|
|
|
|
# todo: getexe (or fix the above
|
2024-08-01 21:22:47 +02:00
|
|
|
displayManager.sessionCommands = ''
|
|
|
|
${pkgs.xorg.xset}/bin/xset r rate 180 50
|
|
|
|
'';
|
2024-10-07 19:56:31 +02:00
|
|
|
enableTearFree = true;
|
2024-08-01 21:22:47 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
environment.systemPackages = with pkgs; [
|
|
|
|
xclip
|
|
|
|
xorg.xkill
|
|
|
|
xorg.xev
|
|
|
|
xdotool
|
|
|
|
];
|
|
|
|
|
2024-08-02 00:10:45 +02:00
|
|
|
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
|
2024-08-01 21:22:47 +02:00
|
|
|
};
|
2024-08-02 00:10:45 +02:00
|
|
|
}
|