Move LTO settings to cachySettings.nix

This commit is contained in:
Lan Tian 2025-12-28 02:15:07 -08:00
parent a3aa71a8eb
commit 696f7401aa
No known key found for this signature in database
GPG Key ID: 04E66B6B25A0862B
2 changed files with 19 additions and 9 deletions

View File

@ -42,6 +42,24 @@ with lib.kernel;
HZ = freeform hz;
});
lto = {
none = {
LTO_NONE = yes;
LTO_CLANG_THIN = no;
LTO_CLANG_FULL = no;
};
thin = {
LTO_NONE = no;
LTO_CLANG_THIN = yes;
LTO_CLANG_FULL = no;
};
full = {
LTO_NONE = no;
LTO_CLANG_THIN = no;
LTO_CLANG_FULL = yes;
};
};
performanceGovernor = {
CPU_FREQ_DEFAULT_GOV_SCHEDUTIL = no;
CPU_FREQ_DEFAULT_GOV_PERFORMANCE = yes;

View File

@ -54,11 +54,6 @@ lib.makeOverridable (
# Additional args are passed to buildLinux.
...
}@args:
assert lib.assertOneOf "LTO Valid Options" lto [
"none"
"thin"
"full"
];
let
helpers = callPackage ../helpers.nix { };
inherit (helpers) stdenvLLVM ltoMakeflags;
@ -118,15 +113,12 @@ lib.makeOverridable (
OVERLAY_FS_XINO_AUTO = no;
OVERLAY_FS_METACOPY = no;
OVERLAY_FS_DEBUG = no;
LTO_NONE = if lto == "none" then lib.kernel.yes else lib.kernel.no;
LTO_CLANG_THIN = if lto == "thin" then lib.kernel.yes else lib.kernel.no;
LTO_CLANG_FULL = if lto == "full" then lib.kernel.yes else lib.kernel.no;
})
# Apply CachyOS specific settings
// (lib.mapAttrs (_: lib.mkForce) (
cachySettings.common
// (cachySettings.lto."${lto}")
// (lib.optionalAttrs (cpusched != null) cachySettings.cpusched."${cpusched}")
// (lib.optionalAttrs kcfi cachySettings.kcfi)
// (lib.optionalAttrs (hzTicks != null) cachySettings.hzTicks."${hzTicks}")