nixos-config/components/gui/xorg/default.nix

82 lines
1.7 KiB
Nix
Raw Normal View History

2019-10-24 02:20:38 +02:00
{ config, pkgs, lib, ... }:
with lib;
2021-11-01 09:20:42 +01:00
{
2019-10-24 02:20:38 +02:00
2023-04-26 09:09:26 +02:00
imports = [ ./xlock.nix ];
2024-05-03 23:43:26 +02:00
options.components.gui.xorg.enable = mkOption {
type = lib.types.bool;
default = config.components.gui.enable;
};
config = mkIf (config.components.gui.xorg.enable && config.components.gui.enable) {
2019-10-24 02:20:38 +02:00
2023-06-30 20:59:11 +02:00
# system.custom.fonts.enable = true;
2024-05-24 21:08:34 +02:00
services.displayManager = {
defaultSession = lib.mkDefault "none+i3";
autoLogin.enable = lib.mkDefault true;
autoLogin.user = config.users.users.mainUser.name;
};
2023-02-17 00:59:29 +01:00
2019-10-24 02:20:38 +02:00
services.xserver = {
enable = true;
2021-03-06 18:11:11 +01:00
displayManager = {
lightdm.enable = lib.mkDefault true;
};
2024-05-04 10:20:22 +02:00
desktopManager.xterm.enable = false;
windowManager.i3.enable = true;
2019-10-24 02:20:38 +02:00
# mouse/touchpad
# --------------
};
2024-05-24 21:08:34 +02:00
services.libinput = {
enable = true;
touchpad = {
disableWhileTyping = true;
tapping = true;
scrollMethod = "twofinger";
accelSpeed = "1.3";
naturalScrolling = true;
horizontalScrolling = true;
};
};
2019-10-24 02:20:38 +02:00
# Packages
# --------
2019-12-20 05:54:26 +01:00
environment.systemPackages = with pkgs; [
2019-10-24 02:20:38 +02:00
2023-02-17 00:59:29 +01:00
xclip
xtrlock-pam
xorg.xev
2019-10-24 02:20:38 +02:00
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 = "";
};
}