Skip to content

nix: Remove (re)definition of KBUILD_OUTPUT from package.nix#93

Open
delet-this wants to merge 4 commits into
AndyFilter:masterfrom
delet-this:fix-nix-quirk
Open

nix: Remove (re)definition of KBUILD_OUTPUT from package.nix#93
delet-this wants to merge 4 commits into
AndyFilter:masterfrom
delet-this:fix-nix-quirk

Conversation

@delet-this
Copy link
Copy Markdown

Resolves #48 by removing the need to (re)define KBUILD_OUTPUT in the package definition. Like I mention here, this was previously needed because kernel and kernelModuleMakeFlags didn't match, so KBUILD_OUTPUT had a value that didn't match the system kernel. Now they should match, thus removing the need to (re)define KBUILD_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.callPackage that automatically provides the system's kernel and kernelModuleMakeFlags.

Ping @kitten

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.
@delet-this
Copy link
Copy Markdown
Author

Rebased

@keenanweaver
Copy link
Copy Markdown

Successfully built and tested on cachyos-latest-lto-zen4. Thank you very much!!

uname -a && sudo dmesg | rg yeet                    
Linux nixos-desktop 7.0.0-cachyos-lto #1-NixOS SMP PREEMPT_DYNAMIC Tue Jan  1 00:00:00 UTC 1980 x86_64 GNU/Linux
[   22.051176] yeetmouse: found a possible mouse (HID) Logitech G502 X LS
[   22.051183] yeetmouse: connecting to device: input13 (Logitech G502 X LS at usb-0000:14:00.0-2.2/input2:1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Quirk with new nixos integration

2 participants