From 65174b4b5c05bb143e6681a4cbcd0a95f04987e2 Mon Sep 17 00:00:00 2001 From: Caroline Larimore Date: Thu, 18 Jul 2024 23:39:42 -0700 Subject: Begin modularization! --- roles/desktop/xserver.nix | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 roles/desktop/xserver.nix (limited to 'roles/desktop/xserver.nix') diff --git a/roles/desktop/xserver.nix b/roles/desktop/xserver.nix new file mode 100644 index 0000000..461de83 --- /dev/null +++ b/roles/desktop/xserver.nix @@ -0,0 +1,28 @@ +{ pkgs, ... }: + +{ + services.displayManager = { + defaultSession = "none+i3"; + }; + + services.xserver = { + videoDrivers = [ "amdgpu" ]; + + displayManager = { + setupCommands = '' + if ${pkgs.xorg.xrandr}/bin/xrandr --query | grep 2560x1080; then + ${pkgs.xorg.xrandr}/bin/xrandr --output DVI-D-0 --mode 1920x1080 --rate 60 --pos 0x0 + ${pkgs.xorg.xrandr}/bin/xrandr --output DisplayPort-2 --mode 2560x1080 --rate 60 --pos 1920x0 --primary + ${pkgs.xorg.xrandr}/bin/xrandr --output HDMI-A-0 --mode 1920x1080 --rate 75 --pos 4480x0 + elif ${pkgs.xorg.xrandr}/bin/xrandr --query | grep 2560x1440; then + ${pkgs.xorg.xrandr}/bin/xrandr --output DVI-D-0 --mode 1920x1080 --rate 60 --pos 0x360 + ${pkgs.xorg.xrandr}/bin/xrandr --output DisplayPort-2 --mode 2560x1440 --rate 165 --pos 1920x0 --primary + ${pkgs.xorg.xrandr}/bin/xrandr --output DisplayPort-1 --mode 1920x1200 --rate 60 --pos 4480x0 + fi + ''; + }; + + xkb.layout = "us"; +# xkb.options = "eurosign:e,caps:escape"; + }; +} -- cgit v1.2.3