nixos-config/nixos/components/gui/xorg/default.nix
2023-06-02 14:08:07 +02:00

90 lines
2 KiB
Nix

{ config, pkgs, lib, ... }:
with lib;
{
imports = [ ./xlock.nix ];
config = mkIf config.components.gui.enable {
system.custom.fonts.enable = true;
services.xserver = {
enable = true;
# window-manager : Xmonad
# -----------------------
displayManager = {
defaultSession = lib.mkDefault "none+i3";
autoLogin.enable = lib.mkDefault true;
autoLogin.user = config.users.users.mainUser.name;
lightdm.enable = lib.mkDefault true;
};
desktopManager = {
xterm.enable = false;
#gnome3.enable = lib.mkDefault true;
};
windowManager = {
xmonad.enable = true;
xmonad.enableContribAndExtras = true;
i3.enable = true;
};
# mouse/touchpad
# --------------
libinput = {
enable = true;
touchpad = {
disableWhileTyping = true;
tapping = true;
scrollMethod = "twofinger";
accelSpeed = "1.3";
naturalScrolling = true;
horizontalScrolling = true;
};
};
# Wacom configuraton
# ------------------
modules = [ pkgs.xf86_input_wacom ];
};
# Packages
# --------
environment.systemPackages = with pkgs; [
xclip
xtrlock-pam
xorg.xev
dmenu
arandr
xcalib
flameshot
feh
];
# Xresources config
# -----------------
# spread the Xresource config
# across different files
# just add a file into `/etc/X11/Xresource.d/` and it will be
# evaluated.
# todo this is better:
#include "/etc/X11/Xresources.d/xterm"
#include "/etc/X11/Xresources.d/rxvt-unicode"
#include "/etc/X11/Xresources.d/fonts"
#include "/etc/X11/Xresources.d/xscreensaver"
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 = "";
};
}