nixos-config/nixos/modules/system/x11.nix

99 lines
2 KiB
Nix
Raw Normal View History

2019-10-24 02:20:38 +02:00
{ config, pkgs, lib, ... }:
with lib;
let
cfg = config.system.custom.x11;
in {
options.system.custom.x11 = {
2019-12-20 05:54:26 +01:00
enable = mkEnableOption "enable x11";
2019-10-24 02:20:38 +02:00
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
# -----------------------
2021-03-06 18:11:11 +01:00
displayManager = {
defaultSession = lib.mkDefault "none+xmonad";
autoLogin.enable = lib.mkDefault true;
autoLogin.user = cfg.autoLoginUser;
lightdm.enable = lib.mkDefault true;
};
desktopManager = {
xterm.enable = false;
2021-07-07 04:38:18 +02:00
#gnome3.enable = lib.mkDefault true;
2021-03-06 18:11:11 +01:00
};
2019-10-24 02:20:38 +02:00
windowManager = {
xmonad.enable = true;
xmonad.enableContribAndExtras = true;
2020-09-03 00:08:52 +02:00
i3.enable = true;
2019-10-24 02:20:38 +02:00
};
# mouse/touchpad
# --------------
libinput = {
enable = true;
2021-07-08 20:43:14 +02:00
touchpad = {
disableWhileTyping = true;
tapping = true;
scrollMethod = "twofinger";
accelSpeed = "2";
2021-07-08 20:43:14 +02:00
};
2019-10-24 02:20:38 +02:00
};
# Wacom configuraton
# ------------------
modules = [ pkgs.xf86_input_wacom ];
};
# Packages
# --------
2019-12-20 05:54:26 +01:00
environment.systemPackages = with pkgs; [
2019-10-24 02:20:38 +02:00
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 = "";
};
}