[Nix-dev] preventing a list from merging

Mathijs Kwik mathijs at bluescreen303.nl
Sun Dec 4 11:46:19 CET 2011


Hi all,

I have a laptop that has 2 graphics cards, low-power intel card for
normal use, and nvidia for gaming/heavy 3d stuff.
Unfortunately, the switching between the 2 isn't flawless under linux
yet (bumblebee project), so I have to choose which one to use.
In my case, the intel card is perfect. It performs well enough for
desktop composition and watching HD video. So I don't want the nvidia
drivers to load at all.

I used these options in configuration.nix:
boot.blacklistedKernelModules = ["nouveau" "nvidia" "nvidiafb"]
services.xserver.videoDrivers = ["intel"]

However, hardware-configuration.nix is mixed-in.
That file contains services.xserver.videoDrivers = ["nvidia"] and
videoDrivers seems to be a list-option that gets merged (listConcat).
So X tries to load nvidia and fails (because the blocked kernel driver).

I temporarily just copied hardware-configuration.nix to
hardware-static.nix and changed the require line in configuration.nix.
Then I edited hardware-static and removed the nvidia line.

However, this doesn't feel right. hardware-configuration.nix is an
auto-generated file and although it probably won't change much (maybe
a driver renames in the future), I would like to use it.
Isn't there some way to override the list concatenation?
Or some way of specifying ["intel" -"nvidia"] to have items taken out at merge?

Technically, the auto-detection _is_ correct though (apart from
missing the intel card entirely), so maybe it's better to not try to
undo its choice, but rather have a way to specify a the preferred X
videodriver (since videoDrivers becomes a list of 2 items).

What options are there?

Thanks,
Mathijs


More information about the nix-dev mailing list