Skip to content

nixos: hardware.nvidia.package option for selecting nvidia package#99323

Merged
veprbl merged 1 commit intoNixOS:masterfrom
eadwu:nvidia/hardware.nvidia.package
Jan 31, 2021
Merged

nixos: hardware.nvidia.package option for selecting nvidia package#99323
veprbl merged 1 commit intoNixOS:masterfrom
eadwu:nvidia/hardware.nvidia.package

Conversation

@eadwu
Copy link
Member

@eadwu eadwu commented Oct 1, 2020

Make it possible to select a derivation to use. This also moves some
logic that belongs to the derivation back into it.

Motivation for this change

#49703 upkeep

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@ofborg ofborg bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. labels Oct 2, 2020
@eadwu eadwu force-pushed the nvidia/hardware.nvidia.package branch from d50497a to 123f8b1 Compare October 7, 2020 18:00
@eadwu eadwu force-pushed the nvidia/hardware.nvidia.package branch from 123f8b1 to ba88f04 Compare October 29, 2020 20:15
@veprbl veprbl requested a review from FRidh November 9, 2020 19:03
@eadwu eadwu force-pushed the nvidia/hardware.nvidia.package branch from ba88f04 to 3cb94f1 Compare November 16, 2020 19:08
@eadwu eadwu force-pushed the nvidia/hardware.nvidia.package branch from 3cb94f1 to a1f6e80 Compare December 21, 2020 06:07
Make it possible to select a derivation to use. This also moves some
logic that belongs to the derivation back into it.
@eadwu eadwu force-pushed the nvidia/hardware.nvidia.package branch from a1f6e80 to 450cb04 Compare January 11, 2021 18:08
@veprbl veprbl merged commit 161b9b2 into NixOS:master Jan 31, 2021
@emmanuelrosa
Copy link
Contributor

I think this should be accompanied with documentation of what the end-user needs to change.

For instance, if the user has something like:

services.xserver.videoDrivers = [ "nvidiaBeta" ];

Meaning, the driver is not simply "nvidia", then it needs to be changed to "nvidia" and then the following needs to be added:

hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.beta;

Of course the documentation should be written more elegantly, but that's the gist of it.

@ncfavier
Copy link
Member

ncfavier commented Jul 25, 2021

Don't forget to update the manual:

</programlisting>
Or if you have an older card, you may have to use one of the legacy drivers:
<programlisting>
<xref linkend="opt-services.xserver.videoDrivers"/> = [ "nvidiaLegacy390" ];
<xref linkend="opt-services.xserver.videoDrivers"/> = [ "nvidiaLegacy340" ];
<xref linkend="opt-services.xserver.videoDrivers"/> = [ "nvidiaLegacy304" ];
</programlisting>

And the example for services.xserver.videoDrivers:

"nvidia" "nvidiaLegacy390" "nvidiaLegacy340" "nvidiaLegacy304"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants