config: add replaceStdenv, cudaCapabilities, cudaForwardCompat options#479234
config: add replaceStdenv, cudaCapabilities, cudaForwardCompat options#479234philiptaron merged 4 commits intoNixOS:masterfrom
Conversation
|
See ##330753 for the last time a similar thing was attempted by @eclairevoyant. Declaring previously-undeclared options broke the Can you read through that PR and make sure you're not falling into the same trap? |
|
Thanks for the heads up! I took a look at #330753 — the issue there was that the declared defaults didn't match the existing fallback values, which broke the In this PR, I made sure to align the defaults with what the code already expects: Verified with |
|
Hmmm... turns out it's not dead code - CI failed cuz some contexts like tarball builds don't go through the module system, so the attribute doesn't exist there. Let me revert it |
|
Mind adding a comment there in the code, then? |
Done |
|
cc @NixOS/cuda-maintainers who I would think are 👍🏻 on this |
|
In principle I'm okay with this; I do want to warn you that adding types for some options can have unintended consequences via strictness induced by module system checking the types. I ran into some infinite recursion errors when I had tried adding options for |
Fixes #479220
Users with config.warnUndeclaredOptions = true were getting warnings for replaceStdenv, cudaCapabilities, and cudaForwardCompat because these options were used but not declared in pkgs/top-level/config.nix.
This PR adds proper option declarations for:
cudaCapabilities: A list of CUDA capabilities to build for (default:[])cudaForwardCompat: Whether to enable PTX support for future hardware (default:true)replaceStdenv: A function to replace the standard environment globally (default:null)Also updates pkgs/stdenv/default.nix to check (config.replaceStdenv or null) != null instead of config ? replaceStdenv, since the option now always exists but may be null.
Things done
Add a 👍 reaction to pull requests you find important.
Contribution by Gittensor, see my contribution statistics at https://gittensor.io/miners/details?githubId=4217675