nixos/opengl: create /run/opengl-driver using tmpfiles.d
Anything that uses OpenGL starts after sysinit.target, so systemd-tmpfiles runs before anything that needs these symlinks.
This commit is contained in:
parent
dab5c632bd
commit
188bdfb95d
@ -129,17 +129,17 @@ in
|
|||||||
message = "Option driSupport32Bit only makes sense on a 64-bit system.";
|
message = "Option driSupport32Bit only makes sense on a 64-bit system.";
|
||||||
};
|
};
|
||||||
|
|
||||||
system.activationScripts.setup-opengl =
|
systemd.tmpfiles.rules = [
|
||||||
''
|
"L+ /run/opengl-driver - - - - ${package}"
|
||||||
ln -sfn ${package} /run/opengl-driver
|
(
|
||||||
${if pkgs.stdenv.isi686 then ''
|
if pkgs.stdenv.isi686 then
|
||||||
ln -sfn opengl-driver /run/opengl-driver-32
|
"L+ /run/opengl-driver-32 - - - - opengl-driver"
|
||||||
'' else if cfg.driSupport32Bit then ''
|
else if cfg.driSupport32Bit then
|
||||||
ln -sfn ${package32} /run/opengl-driver-32
|
"L+ /run/opengl-driver-32 - - - - ${package32}"
|
||||||
'' else ''
|
else
|
||||||
rm -f /run/opengl-driver-32
|
"r /run/opengl-driver-32"
|
||||||
''}
|
)
|
||||||
'';
|
];
|
||||||
|
|
||||||
environment.sessionVariables.LD_LIBRARY_PATH =
|
environment.sessionVariables.LD_LIBRARY_PATH =
|
||||||
[ "/run/opengl-driver/lib" ] ++ optional cfg.driSupport32Bit "/run/opengl-driver-32/lib";
|
[ "/run/opengl-driver/lib" ] ++ optional cfg.driSupport32Bit "/run/opengl-driver-32/lib";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user