From 122026d20c1e6a01f1024f92c991b6ce7140f721 Mon Sep 17 00:00:00 2001 From: Guillaume Bouchard Date: Mon, 27 Apr 2020 17:19:35 +0200 Subject: [PATCH] Add nixGLDefault --- nixGL.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/nixGL.nix b/nixGL.nix index 5dfa5d0..9649d8a 100644 --- a/nixGL.nix +++ b/nixGL.nix @@ -157,6 +157,15 @@ in } '' mkdir -p "$out/bin" - cp "${nixGL}/bin/${nixGL.name}" "$out/bin/nixGL"; + # star because nixGLNvidia... have version prefixed name + cp ${nixGL}/bin/* "$out/bin/nixGL"; ''; + + # The output derivation contains nixGL which point either to + # nixGLNvidia or nixGLIntel using an heuristic. + nixGLDefault = + if builtins.pathExists "/proc/driver/nvidia/version" + then nixGLCommon nixGLNvidia + else nixGLCommon nixGLIntel; + }