From bc2ee24d8bff8a4e8aedfdbda7ba1834499d56c9 Mon Sep 17 00:00:00 2001 From: K900 Date: Sun, 29 Jan 2023 10:51:59 +0300 Subject: [PATCH] fix: relink the X11 socket into place if needed Fixes X11 applications on tmp-as-tmpfs setups. --- modules/wsl-distro.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/wsl-distro.nix b/modules/wsl-distro.nix index e75e7f01..f20bb5bd 100644 --- a/modules/wsl-distro.nix +++ b/modules/wsl-distro.nix @@ -124,6 +124,10 @@ with lib; { # Don't allow emergency mode, because we don't have a console. enableEmergencyMode = false; + + # Link the X11 socket into place. This is a no-op on a normal setup, + # but helps if /tmp is a tmpfs or mounted from some other location. + tmpfiles.rules = [ "L /tmp/.X11-unix - - - - /mnt/wslg/.X11-unix" ]; }; # Start a systemd user session when starting a command through runuser