fix(#540): use systemd.globalEnvironment instead of environment.variables
environment.variables writes to /etc/environment (PAM sessions only) and is not visible to systemd service units. The correct path for env vars that need to reach all systemd services is systemd.globalEnvironment (sets DefaultEnvironment in systemd.conf), which is the pattern established by #608 for HYPERHIVE_STATE_DIR. Also update the inline comment reference from environment.variables to systemd.globalEnvironment.
This commit is contained in:
parent
8a97277f20
commit
cce85a6c1b
1 changed files with 13 additions and 10 deletions
|
|
@ -95,7 +95,7 @@
|
||||||
# --socket=wayland-0: pin the compositor's Wayland socket name
|
# --socket=wayland-0: pin the compositor's Wayland socket name
|
||||||
# to `wayland-0` (weston default is to pick any free name such
|
# to `wayland-0` (weston default is to pick any free name such
|
||||||
# as `wayland-1`). Pinning lets the WAYLAND_DISPLAY=wayland-0
|
# as `wayland-1`). Pinning lets the WAYLAND_DISPLAY=wayland-0
|
||||||
# global env injection below (see environment.variables) take
|
# global env injection below (see systemd.globalEnvironment) take
|
||||||
# effect unconditionally — any Wayland client launched by any
|
# effect unconditionally — any Wayland client launched by any
|
||||||
# systemd service in this container automatically connects to
|
# systemd service in this container automatically connects to
|
||||||
# this compositor instead of failing or starting a second
|
# this compositor instead of failing or starting a second
|
||||||
|
|
@ -114,15 +114,18 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# Expose the compositor's socket to every process in the container
|
# Expose the compositor's socket to every systemd service in the
|
||||||
# so Wayland clients started by any systemd service (e.g. bitburner
|
# container so Wayland clients (e.g. bitburner started via
|
||||||
# launched via a `systemd.services.*` declaration in agent.nix) can
|
# `systemd.services.*` in agent.nix) can find the compositor
|
||||||
# find the compositor without per-service wiring. Without these vars
|
# without per-service wiring. `systemd.globalEnvironment` is the
|
||||||
# a service starting a Wayland client would either fail to connect
|
# correct path (established by #608 for HYPERHIVE_STATE_DIR) —
|
||||||
# (libwayland falls back to creating a headless display) or open a
|
# it sets DefaultEnvironment in systemd.conf, reaching all units
|
||||||
# second compositor entirely — both cause the VNC session to show a
|
# started by PID 1. `environment.variables` goes to /etc/environment
|
||||||
# blank desktop while apps appear to "work" elsewhere (#540).
|
# (PAM sessions only) and is NOT visible to systemd service units.
|
||||||
environment.variables = {
|
# Without these vars a service starting a Wayland client would either
|
||||||
|
# fail to connect (libwayland falls back to a headless display) or
|
||||||
|
# open a second compositor — VNC shows a blank desktop (#540).
|
||||||
|
systemd.globalEnvironment = {
|
||||||
WAYLAND_DISPLAY = "wayland-0";
|
WAYLAND_DISPLAY = "wayland-0";
|
||||||
XDG_RUNTIME_DIR = "/run/user/0";
|
XDG_RUNTIME_DIR = "/run/user/0";
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue