When using nixGL in a flake, it would be convenient to use the auto.nixGLDefault attribute to generate a nixGL wrapper (previously I was generating nixGLnvidia-<version>.
auto.nixGLDefault can't be used in a flake because there are two impure operations, first is generating the version file, and second is fetching the sha256 for the runfile.
This PR prevents those two operations from occuring if the user provides nvidiaVersion and nvidiaHash arguments to nixGL
Hunk 1: prevents the version file generation if nvidiaVersion is passed, see the comment in the code for why this works
Hunk 2: simply passes nvidiaHash to nvidiaPackages, in the case nvidiaHash is null, this should fetch the hash as before.
When using nixGL in a flake, it would be convenient to use the
auto.nixGLDefault
attribute to generate anixGL
wrapper (previously I was generatingnixGLnvidia-<version>
.auto.nixGLDefault
can't be used in a flake because there are two impure operations, first is generating the version file, and second is fetching the sha256 for the runfile.This PR prevents those two operations from occuring if the user provides
nvidiaVersion
andnvidiaHash
arguments to nixGLHunk 1: prevents the version file generation if
nvidiaVersion
is passed, see the comment in the code for why this works Hunk 2: simply passesnvidiaHash
tonvidiaPackages
, in the casenvidiaHash
is null, this should fetch the hash as before.