diff options
author | Tim Keller <tjk@tjkeller.xyz> | 2025-06-09 11:23:00 -0500 |
---|---|---|
committer | Tim Keller <tjk@tjkeller.xyz> | 2025-06-09 11:23:00 -0500 |
commit | 48626e5e2025f38c3fc8ccd02ae430601426e5c4 (patch) | |
tree | 9aee8bab8ec1fa0da5330547aef2d42bc5a2574f | |
parent | 5b4258582a746db941ee1b39fb10abb612f35d2a (diff) | |
download | nixos-48626e5e2025f38c3fc8ccd02ae430601426e5c4.tar.xz nixos-48626e5e2025f38c3fc8ccd02ae430601426e5c4.zip |
use working startx patch from archlinux and make into overlay instead of adding to environment.systempackages
-rw-r--r-- | modules/root/resources/x11/xinit-startx-xdg.patch | 14 | ||||
-rw-r--r-- | modules/root/x11.nix | 30 |
2 files changed, 24 insertions, 20 deletions
diff --git a/modules/root/resources/x11/xinit-startx-xdg.patch b/modules/root/resources/x11/xinit-startx-xdg.patch deleted file mode 100644 index 2c2bf62..0000000 --- a/modules/root/resources/x11/xinit-startx-xdg.patch +++ /dev/null @@ -1,14 +0,0 @@ -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 - diff --git a/modules/root/x11.nix b/modules/root/x11.nix index 72816a9..b7b23ae 100644 --- a/modules/root/x11.nix +++ b/modules/root/x11.nix @@ -8,6 +8,30 @@ services.xserver.displayManager.startx.enable = true; services.libinput.enable = true; # Enable touchpad support + # Apply startx patch to create serverauth file in /tmp instead of home directory + nixpkgs.overlays = with pkgs; [ + (final: prev: { + xorg = prev.xorg // { + xinit = (prev.xorg.xinit.overrideAttrs (oldAttrs: rec { + version = "1.4.4"; + patchtag = "${version}-1"; # Archlinux xinit package tagged release to fetch patch from + # Override src since is hardcoded to 1.4.2 + src = prev.fetchurl { + url = "mirror://xorg/individual/app/xinit-${version}.tar.xz"; + sha256 = "sha256-QKR8ehZMf5gc43h7Szf35BH7QyMdzeVD1wCUB12s/vk="; + }; + patches = [ + (prev.fetchpatch { + url = "https://gitlab.archlinux.org/archlinux/packaging/packages/xorg-xinit/-/raw/${patchtag}/06_move_serverauthfile_into_tmp.diff"; + sha256 = "1whzs5bw7ph12r3abs1g9fydibkr291jh56a0zp17d4x070jnkda"; + }) + ]; + })); + }; + }) + ]; + + # Install basic X utilities environment.systemPackages = with pkgs; [ unclutter xcape @@ -19,12 +43,6 @@ 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 |