summary refs log tree commit diff
path: root/nixos/modules/hardware
diff options
context:
space:
mode:
authorJörg Thalheim <Mic92@users.noreply.github.com>2018-10-02 19:21:34 +0100
committerGitHub <noreply@github.com>2018-10-02 19:21:34 +0100
commitb12c759f76fbd901341aa6ca78fb38a192ef334b (patch)
tree9690df9916e6e14b1d9c1906f3dd30ddef2c887c /nixos/modules/hardware
parent4d1abc44199c8957105f538119c2d19d67aee26f (diff)
parentb63f65aea0dea11c20e9299210af1d2ee4299b58 (diff)
downloadnixlib-b12c759f76fbd901341aa6ca78fb38a192ef334b.tar
nixlib-b12c759f76fbd901341aa6ca78fb38a192ef334b.tar.gz
nixlib-b12c759f76fbd901341aa6ca78fb38a192ef334b.tar.bz2
nixlib-b12c759f76fbd901341aa6ca78fb38a192ef334b.tar.lz
nixlib-b12c759f76fbd901341aa6ca78fb38a192ef334b.tar.xz
nixlib-b12c759f76fbd901341aa6ca78fb38a192ef334b.tar.zst
nixlib-b12c759f76fbd901341aa6ca78fb38a192ef334b.zip
Merge pull request #47563 from jameysharp/unscripted
Replace several activation script snippets with declarative configuration
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";