summary refs log tree commit diff
path: root/nixos/modules/hardware
diff options
context:
space:
mode:
authorJamey Sharp <jamey@minilop.net>2018-09-29 22:52:27 -0700
committerJamey Sharp <jamey@minilop.net>2018-09-30 11:08:12 -0700
commit188bdfb95d7218b931f7d605ad0a5e6961dc3a34 (patch)
treeb915e33e459d87ff9d8626acd3dbc0929465fdc1 /nixos/modules/hardware
parentdab5c632bd2664555292665192cd9f096b5c5bcf (diff)
downloadnixlib-188bdfb95d7218b931f7d605ad0a5e6961dc3a34.tar
nixlib-188bdfb95d7218b931f7d605ad0a5e6961dc3a34.tar.gz
nixlib-188bdfb95d7218b931f7d605ad0a5e6961dc3a34.tar.bz2
nixlib-188bdfb95d7218b931f7d605ad0a5e6961dc3a34.tar.lz
nixlib-188bdfb95d7218b931f7d605ad0a5e6961dc3a34.tar.xz
nixlib-188bdfb95d7218b931f7d605ad0a5e6961dc3a34.tar.zst
nixlib-188bdfb95d7218b931f7d605ad0a5e6961dc3a34.zip
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.
Diffstat (limited to 'nixos/modules/hardware')
-rw-r--r--nixos/modules/hardware/opengl.nix22
1 files changed, 11 insertions, 11 deletions
diff --git a/nixos/modules/hardware/opengl.nix b/nixos/modules/hardware/opengl.nix
index b371af353cf9..46d06d71333a 100644
--- a/nixos/modules/hardware/opengl.nix
+++ b/nixos/modules/hardware/opengl.nix
@@ -129,17 +129,17 @@ in
       message = "Option driSupport32Bit only makes sense on a 64-bit system.";
     };
 
-    system.activationScripts.setup-opengl =
-      ''
-        ln -sfn ${package} /run/opengl-driver
-        ${if pkgs.stdenv.isi686 then ''
-          ln -sfn opengl-driver /run/opengl-driver-32
-        '' else if cfg.driSupport32Bit then ''
-          ln -sfn ${package32} /run/opengl-driver-32
-        '' else ''
-          rm -f /run/opengl-driver-32
-        ''}
-      '';
+    systemd.tmpfiles.rules = [
+      "L+ /run/opengl-driver - - - - ${package}"
+      (
+        if pkgs.stdenv.isi686 then
+          "L+ /run/opengl-driver-32 - - - - opengl-driver"
+        else if cfg.driSupport32Bit then
+          "L+ /run/opengl-driver-32 - - - - ${package32}"
+        else
+          "r /run/opengl-driver-32"
+      )
+    ];
 
     environment.sessionVariables.LD_LIBRARY_PATH =
       [ "/run/opengl-driver/lib" ] ++ optional cfg.driSupport32Bit "/run/opengl-driver-32/lib";