addDriverRunpath: rewrite using makeSetupHook

This commit is contained in:
Stefan Frijters
2025-12-14 17:20:18 +01:00
parent 67d0a225c1
commit 2cb8563445
+13 -13
View File
@@ -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