summaryrefslogtreecommitdiff
path: root/modules/root/x11.nix
blob: 72816a98afd056f63e3d5f1dfc0b974beae52341 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
{ pkgs, lib, config, ... }: {
	options = {
		xserver.enable = lib.mkEnableOption "enables xserver";
	};

	config = lib.mkIf config.xserver.enable {
		services.xserver.enable = true;
		services.xserver.displayManager.startx.enable = true;
		services.libinput.enable = true;  # Enable touchpad support

		environment.systemPackages = with pkgs; [
			unclutter
			xcape
			xclip
			xdotool
			xorg.setxkbmap
			xorg.xinput
			xorg.xkill
			xorg.xrandr
			xorg.xset
			xwallpaper
			# Patch startx to be compliant with xdg base dir spec
			#(xorg.xinit.overrideAttrs (old: rec {
			#	patches = [
			#		./resources/x11/xinit-startx-xdg.patch
			#	];
			#}))
		];

		# Enable TearFree option by default
		# Not all video drivers support this option
		services.xserver.deviceSection = ''
			Option "TearFree" "true"
		'';
	};
}