nixos-config/nixos/components/gui/xorg/default.nix
2024-05-25 02:58:23 +02:00

81 lines
1.6 KiB
Nix

{ config, pkgs, lib, ... }:
with lib;
{
imports = [ ./xlock.nix ];
options.components.gui.xorg.enable = mkOption {
type = lib.types.bool;
default = config.components.gui.enable;
};
config = mkIf config.components.gui.xorg.enable {
# system.custom.fonts.enable = true;
services.displayManager = {
defaultSession = lib.mkDefault "none+i3";
autoLogin.enable = lib.mkDefault true;
autoLogin.user = config.users.users.mainUser.name;
};
services.xserver = {
enable = true;
displayManager = {
lightdm.enable = lib.mkDefault true;
};
desktopManager.xterm.enable = false;
windowManager.i3.enable = true;
# mouse/touchpad
# --------------
};
services.libinput = {
enable = true;
touchpad = {
disableWhileTyping = true;
tapping = true;
scrollMethod = "twofinger";
accelSpeed = "1.3";
naturalScrolling = true;
horizontalScrolling = true;
};
};
# 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.
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 = "";
};
}