96 lines
1.9 KiB
Nix
96 lines
1.9 KiB
Nix
|
{ config, pkgs, lib, ... }:
|
||
|
|
||
|
with lib;
|
||
|
|
||
|
let
|
||
|
|
||
|
cfg = config.system.custom.x11;
|
||
|
|
||
|
in {
|
||
|
|
||
|
options.system.custom.x11 = {
|
||
|
enable = mkEnableOption "enable x11";
|
||
|
autoLoginUser = mkOption {
|
||
|
type = with types; str;
|
||
|
description = "user to login";
|
||
|
};
|
||
|
};
|
||
|
|
||
|
config = mkIf cfg.enable {
|
||
|
|
||
|
services.xserver = {
|
||
|
|
||
|
enable = true;
|
||
|
|
||
|
# Configure video Drivers
|
||
|
# -----------------------
|
||
|
videoDrivers = [ "intel" ];
|
||
|
deviceSection = ''
|
||
|
Option "DRI" "2"
|
||
|
Option "TearFree" "true"
|
||
|
'';
|
||
|
|
||
|
# window-manager : Xmonad
|
||
|
# -----------------------
|
||
|
desktopManager = {
|
||
|
default = "none";
|
||
|
xterm.enable = false;
|
||
|
};
|
||
|
displayManager.lightdm = {
|
||
|
enable = true;
|
||
|
autoLogin.enable = true;
|
||
|
autoLogin.user = cfg.autoLoginUser;
|
||
|
};
|
||
|
windowManager = {
|
||
|
xmonad.enable = true;
|
||
|
xmonad.enableContribAndExtras = true;
|
||
|
default = "xmonad";
|
||
|
};
|
||
|
|
||
|
|
||
|
# mouse/touchpad
|
||
|
# --------------
|
||
|
libinput = {
|
||
|
enable = true;
|
||
|
disableWhileTyping = true;
|
||
|
tapping = true;
|
||
|
scrollMethod = "twofinger";
|
||
|
accelSpeed = "2";
|
||
|
};
|
||
|
|
||
|
# Wacom configuraton
|
||
|
# ------------------
|
||
|
modules = [ pkgs.xf86_input_wacom ];
|
||
|
};
|
||
|
|
||
|
# Packages
|
||
|
# --------
|
||
|
environment.systemPackages = with pkgs ; [
|
||
|
|
||
|
dmenu
|
||
|
arandr
|
||
|
xcalib
|
||
|
flameshot
|
||
|
xorg.xmodmap
|
||
|
feh
|
||
|
|
||
|
];
|
||
|
|
||
|
# Xresources config
|
||
|
# -----------------
|
||
|
# spread the Xresource config
|
||
|
# across different files
|
||
|
# just add a file into `/etc/X11/Xresource.d/` and it will be
|
||
|
# evaluated.
|
||
|
services.xserver.displayManager.sessionCommands = ''
|
||
|
for file in `ls /etc/X11/Xresource.d/`
|
||
|
do
|
||
|
${pkgs.xorg.xrdb}/bin/xrdb -merge /etc/X11/Xresource.d/$file
|
||
|
done
|
||
|
'';
|
||
|
environment.etc."/X11/Xresource.d/.keep".text = "";
|
||
|
|
||
|
};
|
||
|
}
|
||
|
|