{ config, lib, ... }: with lib; let cfg = config.voidconf.xconfig; in { options.voidconf.xconfig = { enable = mkEnableOption "Enables opinionated xorg config"; bqn.enable = mkEnableOption "Enables bqn layout"; touchpad = { enableProperConfig = mkEnableOption "Enable the touchpad settings"; accelProfile = mkOption { type = types.enum [ "flat" "adaptive" ]; default = "adaptive"; example = "flat"; description = '' Usually want this on adaptive. ''; }; }; mouse.accelProfile = mkOption { type = types.enum [ "flat" "adaptive" ]; default = "flat"; example = "adaptive"; description = '' Use addaptive on trackball and touchpad; and flat on any normal mouse. ''; }; lightdm.enable = mkEnableOption "Enables the LightDM display manager and config"; lightdm.background = mkOption { default = ./images/city.png; type = types.path; description = '' Display manager background. ''; }; }; config = mkIf cfg.enable { services.libinput = { mouse = { accelProfile = cfg.mouse.accelProfile; middleEmulation = false; }; touchpad = mkIf cfg.touchpad.enableProperConfig { tapping = false; disableWhileTyping = true; accelProfile = cfg.touchpad.accelProfile; }; }; services.xserver = { xkb = { options = mkIf cfg.bqn.enable "grp:switch"; layout = (if cfg.bqn.enable then "us,bqn" else "us"); extraLayouts.bqn = mkIf cfg.bqn.enable { description = "BQN layout"; languages = [ "bqn" ]; symbolsFile = ./misc/bqn; }; }; enable = true; autoRepeatDelay = 200; autoRepeatInterval = 16; windowManager = { default = "xmonad"; windowmaker.enable = true; xmonad.enable = true; }; displayManager.lightdm = { enable = cfg.lightdm.enable; greeters.gtk.enable = true; background = cfg.lightdm.background; }; }; }; }