Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from Jan 31, 2021

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.

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants