aboutsummaryrefslogtreecommitdiff
path: root/modules/teh-nix/xorg.nix
blob: 67b2c67daf98b809e04bd4f143ae2108ff225ac3 (plain) (blame)
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
{ inputs, ... }:
{
	flake.modules.nixos.teh-nix =
		{
			config,
			lib,
			pkgs,
			...
		}:
		{
			imports = [
				# inputs.YATwm.nixosModules.YATwm
			];

			options.teh-nix.xorg = with lib; {
				enable = mkEnableOption "Enable xorg";
				nvidia = mkOption {
					type = types.bool;
					default = true;
					description = "Enable nvidia with xorg";
				};
			};

			config = lib.mkIf config.teh-nix.xorg.enable {

				teh-nix.nvidia.enable = lib.mkIf config.teh-nix.xorg.nvidia (lib.mkDefault true);

				services.xserver = {
					enable = true;

					desktopManager = {
						xterm.enable = false;
						#default = "none";
					};

					deviceSection = ''
            Option "DRI" "2"
            Option "TearFree" "true"
          '';

					windowManager.i3 = {
						enable = true;
						package = pkgs.i3;
					};

					# windowManager.YATwm = {
					#     enable = true;
					#     package = inputs.YATwm.packages.x86_64-linux.YATwm;
					# };
				};
				programs.i3lock.enable = true;

				services.displayManager = {
					#defaultSession = "none+i3";
					sddm.enable = true;
					#sddm.theme = "catppuccin-macchiato";
					# ly.enable = true;
				};

				services.xserver.xkb.layout = "us";
				services.xserver.xkb.options = "caps:super";
			};
		};
}