gpu: use tmpfiles.d to set up the /run/opengl-driver symlink

Signed-off-by: Esteve Fernandez <esteve@apache.org>
This commit is contained in:
Esteve Fernandez
2026-05-04 22:17:46 +02:00
committed by Matthieu Coudron
parent a89686d115
commit 5be632dab0
8 changed files with 43 additions and 31 deletions

View File

@@ -38,16 +38,17 @@ GPU drivers require an update, run
Because the `/run` directory is volatile and disappears on reboot, libraries
cannot be simply copied or linked there. The `non-nixos-gpu-setup` script
installs a Systemd service which ensures that the drivers are linked to
`/run/opengl-driver` on boot. Home Manager will always check and warn you when
this setup needs to be refreshed.
installs a
[`tmpfiles.d`](https://www.freedesktop.org/software/systemd/man/latest/tmpfiles.d.html)
config which ensures that the drivers are linked to `/run/opengl-driver` on
boot. Home Manager will always check and warn you when this setup needs to be
refreshed.
If you ever wish to uninstall these drivers, all you need to do is
```sh
sudo rm /run/opengl-driver
sudo systemctl disable --now non-nixos-gpu.service
sudo rm /etc/systemd/system/non-nixos-gpu.service
sudo rm /etc/tmpfiles.d/non-nixos-gpu.conf
```