nix: Remove (re)definition of KBUILD_OUTPUT from package.nix#93
Open
delet-this wants to merge 4 commits into
Open
nix: Remove (re)definition of KBUILD_OUTPUT from package.nix#93delet-this wants to merge 4 commits into
KBUILD_OUTPUT from package.nix#93delet-this wants to merge 4 commits into
Conversation
This was referenced Apr 14, 2026
Using callPackage is bit more idiomatic here.
This is also bit more idiomatic in my opinion, and gives us the correct `kernelModuleMakeFlags`.
Shouldn't be needed anymore as we should get a correct `kernelModuleMakeFlags` now.
Require passing them explicitly to hopefully prevent mismatching `kernel` and `kernelModuleMakeFlags` in the future.
75bd6e8 to
f237ceb
Compare
Author
|
Rebased |
|
Successfully built and tested on |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #48 by removing the need to (re)define
KBUILD_OUTPUTin the package definition. Like I mention here, this was previously needed becausekernelandkernelModuleMakeFlagsdidn't match, soKBUILD_OUTPUThad a value that didn't match the system kernel. Now they should match, thus removing the need to (re)defineKBUILD_OUTPUT.While the Chaotic Nyx project mentioned in the original issue seems to be deprecated now, I was able to test this with https://github.com/xddxdd/nix-cachyos-kernel which had the same behavior. Before the changes I got the same build error when I removed the
KBUILD_OUTPUT, with these changes it builds normally.Technically it would have been enough to add
kernelModuleMakeFlags = config.boot.kernelPackages.kernelModuleMakeFlags;to the overrides, but I thought to also make the code a bit more (imo) idiomatic here.This pr has multiple changes, but I split them to commits so hopefully that helps reviewing. The reason I removed the usage of the overlay from the NixOS module is that it felt a bit awkward first pass the "wrong" kernel and then override it manually later, instead of using
config.boot.linuxPackages.callPackagethat automatically provides the system'skernelandkernelModuleMakeFlags.Ping @kitten