-
-
Notifications
You must be signed in to change notification settings - Fork 15.3k
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
Add lib.kernel #70157
Add lib.kernel #70157
Conversation
Remove the "version" parameter in order to make it more widely available. Starts making some kernel configuration helpers available. The intent is to be able to better build and check the linux kernel configuration.
whenAtLeast/whenBetween are made available in lib/kernel.nix but are now scoped under whenXXX.
I don't think package-specific functions should be in |
IMO, the kernel configuration is not a package-specific operation (rather platform/linux specific). There is already a library to configure the kernel that is used across nixpkgs:
I deal with many types of kernels: out-of-tree kernels, computer-specific configurations, different versions as well as different testing setups (openvswitch/mininet/nixops-libvirtd with virtio reuquirements), builtin modules in order not to have to build an initramfs. This is my single biggest complaint about nixos, it's all about reproducibility/dependency management, yet when it comes to the kernel we are not allowed to specify/check dependencies. It doesn't have to be like that. It's reasonibly easy to implement and can be opt-in if there are concerns. |
for instance one can try to build a kernel with a configuration supposed to be checked by nixpkgs (module support is mandatory):
yet none of it is checked by nixpkgs, it just fails building. But for an option that doesn't break the build, it could easily go unnoticed. There are multiple issues that show that kernel configuration checks could be useful
|
Looking good! Since this has been unnoticed for a while, is this still fresh or does it need adjustments before merging? |
it's up to date ty ! |
Motivation for this change
I would like to improve the kernel configuration system, #69013 looks blocked so I extracted what I believed is less controversial here.
I would like afterwards to get rid of the string format
in favor of the more powerful
structuredExtraConfig
that is not documented (and thus not used) because it is presently too hard to use:kernelItem
submoduleMerging this will help move forward with #69014
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nix-review --run "nix-review wip"
./result/bin/
)nix path-info -S
before and after)Notify maintainers
cc @