diff --git a/pkgs/by-name/ad/addDriverRunpath/package.nix b/pkgs/by-name/ad/addDriverRunpath/package.nix index 7e31a396b463..29832b303ad6 100644 --- a/pkgs/by-name/ad/addDriverRunpath/package.nix +++ b/pkgs/by-name/ad/addDriverRunpath/package.nix @@ -1,14 +1,14 @@ -{ lib, stdenv }: +{ + lib, + stdenv, + makeSetupHook, +}: +makeSetupHook { + name = "add-driver-runpath-hook"; -stdenv.mkDerivation { - name = "add-driver-runpath"; - - # Named "opengl-driver" for legacy reasons, but it is the path to - # hardware drivers installed by NixOS - env.driverLink = "/run/opengl-driver" + lib.optionalString stdenv.hostPlatform.isi686 "-32"; - - buildCommand = '' - mkdir -p $out/nix-support - substituteAll ${./setup-hook.sh} $out/nix-support/setup-hook - ''; -} + substitutions = { + # Named "opengl-driver" for legacy reasons, but it is the path to + # hardware drivers installed by NixOS + driverLink = "/run/opengl-driver" + lib.optionalString stdenv.hostPlatform.isi686 "-32"; + }; +} ./setup-hook.sh