voidconf/modules/xconfig.nix

87 lines
2.1 KiB
Nix
Raw Normal View History

2023-12-16 19:26:15 +01:00
{ config, lib, ... }:
with lib;
2024-02-17 18:49:37 +01:00
let cfg = config.voidconf.xconfig;
2023-12-16 19:26:15 +01:00
in {
2024-02-17 18:49:37 +01:00
options.voidconf.xconfig = {
2023-12-16 19:26:15 +01:00
enable = mkEnableOption "Enables opinionated xorg config";
bqn.enable = mkEnableOption "Enables bqn layout";
2024-01-03 13:59:25 +01:00
touchpad = {
2024-07-04 10:52:35 +02:00
enableProperConfig = mkEnableOption "Enable the touchpad settings";
2024-01-03 13:59:25 +01:00
accelProfile = mkOption {
type = types.enum [ "flat" "adaptive" ];
default = "adaptive";
example = "flat";
description = ''
Usually want this on adaptive.
2024-05-20 11:13:43 +02:00
'';
2024-01-03 13:59:25 +01:00
};
2023-12-16 19:26:15 +01:00
2024-01-01 17:59:39 +01:00
};
2023-12-16 19:26:15 +01:00
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.
'';
};
2023-12-27 13:30:49 +01:00
lightdm.enable = mkEnableOption "Enables the LightDM display manager and config";
2023-12-27 13:17:57 +01:00
lightdm.background = mkOption {
2023-12-16 19:26:15 +01:00
default = ./images/city.png;
type = types.path;
description = ''
Display manager background.
'';
};
};
config = mkIf cfg.enable {
2024-06-01 14:06:25 +02:00
services.libinput = {
mouse = {
accelProfile = cfg.mouse.accelProfile;
middleEmulation = false;
};
touchpad = mkIf cfg.touchpad.enableProperConfig {
tapping = false;
disableWhileTyping = true;
accelProfile = cfg.touchpad.accelProfile;
};
};
2023-12-16 19:26:15 +01:00
services.xserver = {
2024-06-01 14:06:25 +02:00
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;
};
2023-12-16 19:26:15 +01:00
};
enable = true;
autoRepeatDelay = 200;
autoRepeatInterval = 16;
2023-12-16 19:26:15 +01:00
windowManager = {
2024-07-04 10:52:35 +02:00
default = "xmonad";
2023-12-16 19:26:15 +01:00
windowmaker.enable = true;
xmonad.enable = true;
};
2023-12-27 14:45:39 +01:00
displayManager.lightdm = {
enable = cfg.lightdm.enable;
2023-12-16 19:26:15 +01:00
greeters.gtk.enable = true;
2023-12-27 14:45:39 +01:00
background = cfg.lightdm.background;
2023-12-16 19:26:15 +01:00
};
};
};
}