Due to a setting I enabled (crash dump kernel) doing a nixos-rebuild sometimes needs to rebuild my kernel from scratch, which I would like to make faster by using ccache.
I found the programs.ccache.packageNames option, which allows setting packages that should be built using ccache.
However, this does not actually cause ccache to be used to build the kernel, i.e., CCACHE_DIR="/var/cache/ccache" ccache -s reports an empty/unused cache directory.
What is the correct name to give to programs.ccache.packageNames to enable ccache when my kernel is being built?
(Small extra question: How can I easily test this, i.e., trigger a rebuild of my kernel when it’s not necessary?)
Yeah that’s what I meant. I had boot.crashDump.enable on true, changed it to false and rebuilt one time, then set it back to true, but that didn’t cause a rebuild (which I guess makes sense). I guess I could run gc after setting it to false?
Just had a system update that included rebuilding the kernel, but it didn’t use ccache (i.e., CCACHE_DIR="/var/cache/ccache" ccache -s still reports an empty cache).
What is the correct package name/would be a way to find the correct package name, as it doesn’t seem to be linux?
The problem here seems to be that the kernel build references buildPackages.stdenv.cc in depsBuildBuild; this needs to be overridden with ccacheStdenv too.