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 #49703
Conversation
hardware.nvidia.package = lib.mkOption { | ||
type = lib.types.package; | ||
default = config.boot.kernelPackages.nvidia_x11; | ||
defaultText = "config.boot.kernelPackages.nvidia_x11"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm thinking we should also get rid of the aliases and use instead
config.boot.kernelPackages.nvidiaPackages.stable
Note this breaks the config for people using |
AFAICT overriding the
|
@coreyoconnor yep, there are typically multiple ways to achieve the same output. This is about user interface and having a consistent way of selecting a package in a module. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would make sense to add an assertion that checks for any nvidiaxx
values in the driver list and error out with the corresponding equivalent config after this change.
@@ -96,6 +78,16 @@ in | |||
shows the Intel GPU at "00:02.0", set this option to "PCI:0:2:0". | |||
''; | |||
}; | |||
|
|||
hardware.nvidia.package = lib.mkOption { | |||
type = lib.types.package; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lib
is already with
'd above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was not addressed, but it's just a nitpick. What I meant is that you can replace type = lib.types.package
with type = types.package
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know, I just think we should keep the lib
prefix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Huh why? I know some people don't like with
, but either we use it for the whole file or not at all. I wouldn't mind either, but this mixed style is odd.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any resolution to this?
In case this ever gets merged, it might be a good idea to change https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/hardware/video/bumblebee.nix#L80 as well for those who still use Bumblebee. |
The module will now check for driver names with versions. It's ugly but it functions. Regarding |
@vcunat @infinisil could you give this (one more) look? I intend to otherwise merge in a couple of days. |
hasDeprecated = drivers: any isDeprecated drivers; | ||
in if (hasDeprecated drivers) then | ||
throw '' | ||
Selecting an nvidia driver has been modified for NixOS 19.03. The version is now set using `hardware.nvidia.package`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should show in the error message already what package the user should choose based on their previous setting. We have all the information we need to make a better error message and ease the transition for users.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I guess it should be fine to simply add one "legacy" example and maybe also one "beta" example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Appears to be OK to me.
BTW, note: #50861 (comment)
This pull request has been mentioned on Nix community. There might be relevant details there: https://discourse.nixos.org/t/use-nvidia-410-drivers-on-nixos/1364/16 |
This PR is stale for half a year, with only two minor changes required. |
ping |
Hello, I'm a bot and I thank you in the name of the community for your contributions. Nixpkgs is a busy repository, and unfortunately sometimes PRs get left behind for too long. Nevertheless, we'd like to help committers reach the PRs that are still important. This PR has had no activity for 180 days, and so I marked it as stale, but you can rest assured it will never be closed by a non-human. If this is still important to you and you'd like to remove the stale label, we ask that you leave a comment. Your comment can be as simple as "still important to me". But there's a bit more you can do: If you received an approval by an unprivileged maintainer and you are just waiting for a merge, you can @ mention someone with merge permissions and ask them to help. You might be able to find someone relevant by using Git blame on the relevant files, or via GitHub's web interface. You can see if someone's a member of the nixpkgs-committers team, by hovering with the mouse over their username on the web interface, or by searching them directly on the list. If your PR wasn't reviewed at all, it might help to find someone who's perhaps a user of the package or module you are changing, or alternatively, ask once more for a review by the maintainer of the package/module this is about. If you don't know any, you can use Git blame on the relevant files, or GitHub's web interface to find someone who touched the relevant files in the past. If your PR has had reviews and nevertheless got stale, make sure you've responded to all of the reviewer's requests / questions. Usually when PR authors show responsibility and dedication, reviewers (privileged or not) show dedication as well. If you've pushed a change, it's possible the reviewer wasn't notified about your push via email, so you can always officially request them for a review, or just @ mention them and say you've addressed their comments. Lastly, you can always ask for help at our Discourse Forum, or more specifically, at this thread or at #nixos' IRC channel. |
I would still like it 👍 |
+1 Like to have this, too. |
I can probably maintain this PR until it's merged and if @FRidh doesn't have the time? Not sure if ownership can be switched but I'll probably create a new PR if needed. |
Make it possible to select a derivation to use. This also moves some logic that belongs to the derivation back into it.
I've rebased this PR (and it builds again) but I don't intend to go further with it. Feel free to take it over! Creating a new PR is fine. |
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
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)