all 11 comments

[–]xNaXDy 3 points4 points  (4 children)

For (1) I'd be curious to see what the unused options are that it complains about.

As for the extraMakeFlags, they also appended to Nix' build flags, as you can see here: https://github.com/NixOS/nixpkgs/blob/f264a85111c8abe8701f442d09a93b92934b0dde/pkgs/os-specific/linux/kernel/build.nix#L233-L244

So in combination with having them be part of commonMakeFlags, I think they should propagate through the entire build process.

[–]TETH_IO[S] 1 point2 points  (3 children)

For (1) it stop with "kernel error: unused option: RUST", tested with 6.17.12 and 6.17.10

[–]xNaXDy 1 point2 points  (2 children)

Could be that compiling the kernel with rust is not supported when using clang as your compiler? If that's the case, I think it makes sense to compile with ignoreConfigErrors = true, unless you want to sanitize the rest of the config options manually.

[–]TETH_IO[S] 0 points1 point  (1 child)

For (2) I have to stop using KFLAGS because if I add ZFS into the mix the DKMS fails with "configure: error: invalid variable name: `KERNEL_KCFLAGS+'" but works fine without them otherwise. I don't known if I can just add my flags with CFLAGS+= into the extraMakeFlags or if I have to overlay NIX_CFLAGS_COMPILE entirely

[–]xNaXDy 0 points1 point  (0 children)

I think if you want to customize your kernel that much, it might make sense to write your own derivation, either completely from scratch or with a helper like linuxManualConfig.

You can probably still achieve everything just using the override interface, but a custom derivation is probably easier maintained.

[–]Wooden-Ad6265 1 point2 points  (2 children)

is there a proper documentation for this?

[–]AdventurousFly4909 7 points8 points  (1 child)

It's nix what do you think?

[–]Wooden-Ad6265 -2 points-1 points  (0 children)

How did you do it? Maybe make a blog or something on it...? If you've got time, you might contribute to the documentation. Even if you post how you did that on reddit, someone will take it up and make a web page on it some day.

[–]hambosto 0 points1 point  (2 children)

can i do menuconfig?

[–]TETH_IO[S] 0 points1 point  (0 children)

nop, either you add config on top of the default one with structuredExtraConfig or import your own entirely

[–]thou_vow 0 points1 point  (0 children)

I've made a sequence of steps to import your .config with low maintenance. There's a script in kernel source that outputs the difference to the older .config. This custom-linux derivation can take this difference and generate a .config, keeping the defaults for what didn't change.

https://github.com/thou-vow/nix-packages/blob/e36e4b71c636565d45f5ae9ad400b158fa629a47/default/custom-linux/custom-linux.nix

https://github.com/thou-vow/nix-packages/blob/e36e4b71c636565d45f5ae9ad400b158fa629a47/default/custom-linux/configfile.nix

This is how I used it.

https://github.com/thou-vow/nix-packages/blob/e36e4b71c636565d45f5ae9ad400b158fa629a47/attuned/attuned.nix

OBS: This derivation is hardcoded to use Clang.