Introduce config.me.optimizations.enable to toggle optimizations.

This is more granular than the buildingIso setting.
This commit is contained in:
Tom Alexander
2025-05-04 15:12:41 -04:00
parent a36ebbf94c
commit c68a6aaa19
9 changed files with 111 additions and 77 deletions

View File

@@ -15,6 +15,7 @@
time.timeZone = "America/New_York";
i18n.defaultLocale = "en_US.UTF-8";
me.optimizations.enable = false;
me.secureBoot.enable = false;
# Early KMS

View File

@@ -9,22 +9,15 @@
config = lib.mkMerge [
{ }
(lib.mkIf (!config.me.buildingIso) {
nix.settings.system-features = lib.mkForce [
"gccarch-alderlake"
"gccarch-x86-64-v3"
"benchmark"
"big-parallel"
"kvm"
"nixos-test"
];
# nixpkgs.hostPlatform = {
# gcc.arch = "alderlake";
# gcc.tune = "alderlake";
# system = "x86_64-linux";
# };
(lib.mkIf (!config.me.optimizations.enable) {
boot.kernelPackages = pkgs.linuxPackagesFor pkgs.linux_6_13;
})
(lib.mkIf (config.me.optimizations.enable) {
nixpkgs.hostPlatform = {
gcc.arch = "alderlake";
gcc.tune = "alderlake";
system = "x86_64-linux";
};
nixpkgs.overlays = [
(
@@ -42,7 +35,7 @@
});
in
{
linux_alderlake =
linux_me =
addConfig
{
# Full preemption
@@ -68,10 +61,19 @@
)
];
boot.kernelPackages = pkgs.linuxPackagesFor pkgs.linux_alderlake;
boot.kernelPackages = pkgs.linuxPackagesFor pkgs.linux_me;
})
(lib.mkIf (!config.me.buildingIso) {
nix.settings.system-features = lib.mkForce [
"gccarch-alderlake"
"gccarch-x86-64-v3"
"benchmark"
"big-parallel"
"kvm"
"nixos-test"
];
})
(lib.mkIf (config.me.buildingIso) {
boot.kernelPackages = pkgs.linuxPackagesFor pkgs.linux_6_12;
boot.supportedFilesystems = [ "zfs" ];
})
];