Change condition to check actually used kernel version instead of which kernel version is the default.
Without this change, if a user changes the kernel version to a newer version, the kernel parameter will not actually be added.
630: starfive visionfive2: update kernel to 6.4.0 r=Mic92 a=NickCao
649: macbook-air-6: remove mba6x_bl kernel module r=Mic92 a=DanielSiepmann
650: apple/t2: init r=Mic92 a=networkException
652: build(deps): bump cachix/install-nix-action from 21 to 22 r=Mic92 a=dependabot[bot]
654: fixing iptsd not able to find DEVICE r=Mic92 a=buttergrillcorn
656: treewide: avoid alias usage for intel-vaapi-driver based on nixos version r=Mic92 a=lilyinstarlight
657: Added more blocked Nvidia kernel modules to fix the dGPU not being disabled r=Mic92 a=spacebanana420
Co-authored-by: Nick Cao <nickcao@nichi.co>
Co-authored-by: Daniel Siepmann <coding@daniel-siepmann.de>
Co-authored-by: kekrby <kekrby@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: buttergrillcorn <126628446+buttergrillcorn@users.noreply.github.com>
Co-authored-by: Lily Foster <lily@lily.flowers>
Co-authored-by: Space Banana <tomasbessa@protonmail.com>
The `-a` from exec sets the `$0` from the process. So `exec -a "$0"`
would set the name of the new process to `nvidia-offload` (the name of
the script), however this is causing issues with a few programs that try
to interpret `$0` in a special way. For example, see `wine`:
```
$ nvidia-offload /nix/store/zhv91s26gsrl1w8yn9800xd03a31r3wj-wine-osu-7.0/bin/wine .osu/drive_c/osu/osu\!.exe
/nix/store/zhv91s26gsrl1w8yn9800xd03a31r3wj-wine-osu-7.0/bin/nvidia-offload: could not open
```
What I think `wine` is doing here is trying to re-exec `wine` again, but
to do so it tries to figure out the original call of wine by readind `$0`,
and will fail in this case because the `$0` was changed because of the
`nvidia-offload` script using `-a` flag, as explained above.
Instead, let's simplify this. There is no good reason to rename the `$0`
from the script anyway (it just sets a few environment variables), so let's
just remove it. We may lose the ability to know if the command is being
offloaded, but I think having more commands to work is a good trade-off.
`libvdpau-va-gl` is a wrapper around VAAPI to have a VDPAU driver, which
is required for Intel GPU's. `VDPAU_DRIVER` environment variable is set
to "va_gl", since it defaults to "nvidia".
Two reasons for this change:
- `intel` drivers are not updated from quite a long time (since ~2019),
and `modesetting` is the preferred one for Intel iGPUs.
- Technically you may want to disable NVIDIA GPUs on laptops with AMD
processors too.
We don't want to pin `modesetting` here because it is already the default
since PR: https://github.com/NixOS/nixpkgs/pull/111551.