voidconf/modules/xconfig.nix

97 lines
2.2 KiB
Nix
Raw Normal View History

2023-12-16 19:26:15 +01:00
{ config, lib, ... }:
with lib;
2025-04-18 09:37:57 +02:00
let
cfg = config.voidconf.xconfig;
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 {
2025-04-18 09:37:57 +02:00
type = types.enum [
"flat"
"adaptive"
];
2024-01-03 13:59:25 +01:00
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 {
2025-04-18 09:37:57 +02:00
type = types.enum [
"flat"
"adaptive"
];
2023-12-16 19:26:15 +01:00
default = "flat";
example = "adaptive";
description = ''
2025-04-18 09:37:57 +02:00
Use addaptive on trackball and touchpad; and flat on any normal mouse.
2023-12-16 19:26:15 +01:00
'';
};
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 = ''
2025-04-18 09:37:57 +02:00
Display manager background.
2023-12-16 19:26:15 +01:00
'';
};
};
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 = {
windowmaker.enable = true;
2024-12-02 09:57:30 +01:00
xmonad = {
enable = true;
extraPackages = h: with h; [ xmonad-contrib ];
};
2023-12-16 19:26:15 +01:00
};
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
};
};
};
}