diff options
Diffstat (limited to 'modules/x11')
-rw-r--r-- | modules/x11/default.nix | 30 | ||||
-rw-r--r-- | modules/x11/xinit-startx-xdg.patch | 14 |
2 files changed, 44 insertions, 0 deletions
diff --git a/modules/x11/default.nix b/modules/x11/default.nix new file mode 100644 index 0000000..8fa1d27 --- /dev/null +++ b/modules/x11/default.nix @@ -0,0 +1,30 @@ +{ 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 = [ + ./xinit-startx-xdg.patch + ]; + })) + ]; + }; +} diff --git a/modules/x11/xinit-startx-xdg.patch b/modules/x11/xinit-startx-xdg.patch new file mode 100644 index 0000000..c1bca97 --- /dev/null +++ b/modules/x11/xinit-startx-xdg.patch @@ -0,0 +1,14 @@ +diff --git a/startx.cpp b/startx.cpp +index dfbebe1..472a1b0 100644 +--- a/startx.cpp ++++ b/startx.cpp +@@ -272,7 +272,7 @@ if [ x"$enable_xauth" = x1 ] ; then + dummy=0 + + XCOMM create a file with auth information for the server. ':0' is a dummy. +- xserverauthfile=$HOME/.serverauth.$$ ++ xserverauthfile="${XAUTHORITY:-$HOME/.Xauthority}" + trap "rm -f '$xserverauthfile'" HUP INT QUIT ILL TRAP BUS TERM + xauth -q -f "$xserverauthfile" << EOF + add :$dummy . $mcookie + |