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.
@eadwu eadwu force-pushed the nvidia/hardware.nvidia.package branch from d50497a to 123f8b1 Oct 7, 2020
@eadwu eadwu force-pushed the nvidia/hardware.nvidia.package branch from 123f8b1 to ba88f04 Oct 29, 2020
@veprbl veprbl requested a review from FRidh Nov 9, 2020
@eadwu eadwu force-pushed the nvidia/hardware.nvidia.package branch from ba88f04 to 3cb94f1 Nov 16, 2020
@eadwu eadwu force-pushed the nvidia/hardware.nvidia.package branch from 3cb94f1 to a1f6e80 Dec 21, 2020
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 Jan 11, 2021
@veprbl veprbl merged commit 161b9b2 into NixOS:master Jan 31, 2021
18 checks passed
@emmanuelrosa
Copy link
Contributor

@emmanuelrosa emmanuelrosa commented Jan 31, 2021

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
Contributor

@ncfavier 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
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants