[Nix-dev] preventing a list from merging
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 ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
Re: [Nix-dev] preventing a list from merging
Excerpts from Mathijs Kwik's message of Sun Dec 04 11:46:19 +0100 2011: 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. You're right. But its easy and fast to do. You can regenerate the hardware file occasionally and merge in changes. You can spend countless hours on generating the perfect setup which can be broken easily by any kernel changes. Auto generated hardware file: I don't think its either complete nor stable - so taking as snapshot is a nice solution for now even it feels wrong. If it works - keep it. Also note that you can always overwrite setting using mkOverwrite 2000 ['the list taking precedence over everything else'] in your configuration.nix file. Then you can keep merging everything else from the auto file only overwriting your special stuff. Marc Weber ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
Re: [Nix-dev] preventing a list from merging
On Sun, Dec 4, 2011 at 12:04 PM, Marc Weber marco-owe...@gmx.de wrote: Excerpts from Mathijs Kwik's message of Sun Dec 04 11:46:19 +0100 2011: 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. You're right. But its easy and fast to do. You can regenerate the hardware file occasionally and merge in changes. You can spend countless hours on generating the perfect setup which can be broken easily by any kernel changes. Auto generated hardware file: I don't think its either complete nor stable - so taking as snapshot is a nice solution for now even it feels wrong. If it works - keep it. Okay thanks, it's indeed not that important to try to automate. Also note that you can always overwrite setting using mkOverwrite 2000 ['the list taking precedence over everything else'] in your configuration.nix file. Then you can keep merging everything else from the auto file only overwriting your special stuff. Is there a way to refer to the default too? something like: someList = mkOverride 2000 (filter (!= blah) origInalSomeList) Marc Weber ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
Re: [Nix-dev] preventing a list from merging
refer to default? Don't think so. Pierron should know it - but it may take a couple of days until he has time to reply. Copy paste for now. If something breaks you know where to look at. Marc Weber ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev