Introduce config.me.optimizations.enable to toggle optimizations.
This is more granular than the buildingIso setting.
This commit is contained in:
parent
a36ebbf94c
commit
c68a6aaa19
@ -137,6 +137,7 @@
|
|||||||
isoImage.makeEfiBootable = true;
|
isoImage.makeEfiBootable = true;
|
||||||
isoImage.makeUsbBootable = true;
|
isoImage.makeUsbBootable = true;
|
||||||
me.buildingIso = true;
|
me.buildingIso = true;
|
||||||
|
me.optimizations.enable = false;
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
@ -163,6 +164,7 @@
|
|||||||
isoImage.makeEfiBootable = true;
|
isoImage.makeEfiBootable = true;
|
||||||
isoImage.makeUsbBootable = true;
|
isoImage.makeUsbBootable = true;
|
||||||
me.buildingIso = true;
|
me.buildingIso = true;
|
||||||
|
me.optimizations.enable = false;
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
@ -187,6 +189,7 @@
|
|||||||
isoImage.makeEfiBootable = true;
|
isoImage.makeEfiBootable = true;
|
||||||
isoImage.makeUsbBootable = true;
|
isoImage.makeUsbBootable = true;
|
||||||
me.buildingIso = true;
|
me.buildingIso = true;
|
||||||
|
me.optimizations.enable = false;
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
@ -36,6 +36,7 @@
|
|||||||
time.timeZone = "America/New_York";
|
time.timeZone = "America/New_York";
|
||||||
i18n.defaultLocale = "en_US.UTF-8";
|
i18n.defaultLocale = "en_US.UTF-8";
|
||||||
|
|
||||||
|
me.optimizations.enable = true;
|
||||||
me.secureBoot.enable = false;
|
me.secureBoot.enable = false;
|
||||||
|
|
||||||
# Mount tmpfs at /tmp
|
# Mount tmpfs at /tmp
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
time.timeZone = "America/New_York";
|
time.timeZone = "America/New_York";
|
||||||
i18n.defaultLocale = "en_US.UTF-8";
|
i18n.defaultLocale = "en_US.UTF-8";
|
||||||
|
|
||||||
|
me.optimizations.enable = false;
|
||||||
me.secureBoot.enable = false;
|
me.secureBoot.enable = false;
|
||||||
|
|
||||||
# Early KMS
|
# Early KMS
|
||||||
|
@ -9,22 +9,15 @@
|
|||||||
|
|
||||||
config = lib.mkMerge [
|
config = lib.mkMerge [
|
||||||
{ }
|
{ }
|
||||||
(lib.mkIf (!config.me.buildingIso) {
|
(lib.mkIf (!config.me.optimizations.enable) {
|
||||||
nix.settings.system-features = lib.mkForce [
|
boot.kernelPackages = pkgs.linuxPackagesFor pkgs.linux_6_13;
|
||||||
"gccarch-alderlake"
|
})
|
||||||
"gccarch-x86-64-v3"
|
(lib.mkIf (config.me.optimizations.enable) {
|
||||||
"benchmark"
|
nixpkgs.hostPlatform = {
|
||||||
"big-parallel"
|
gcc.arch = "alderlake";
|
||||||
"kvm"
|
gcc.tune = "alderlake";
|
||||||
"nixos-test"
|
system = "x86_64-linux";
|
||||||
];
|
};
|
||||||
|
|
||||||
# nixpkgs.hostPlatform = {
|
|
||||||
# gcc.arch = "alderlake";
|
|
||||||
# gcc.tune = "alderlake";
|
|
||||||
# system = "x86_64-linux";
|
|
||||||
|
|
||||||
# };
|
|
||||||
|
|
||||||
nixpkgs.overlays = [
|
nixpkgs.overlays = [
|
||||||
(
|
(
|
||||||
@ -42,7 +35,7 @@
|
|||||||
});
|
});
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
linux_alderlake =
|
linux_me =
|
||||||
addConfig
|
addConfig
|
||||||
{
|
{
|
||||||
# Full preemption
|
# 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) {
|
(lib.mkIf (config.me.buildingIso) {
|
||||||
boot.kernelPackages = pkgs.linuxPackagesFor pkgs.linux_6_12;
|
|
||||||
boot.supportedFilesystems = [ "zfs" ];
|
boot.supportedFilesystems = [ "zfs" ];
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
time.timeZone = "America/New_York";
|
time.timeZone = "America/New_York";
|
||||||
i18n.defaultLocale = "en_US.UTF-8";
|
i18n.defaultLocale = "en_US.UTF-8";
|
||||||
|
|
||||||
|
me.optimizations.enable = true;
|
||||||
me.secureBoot.enable = true;
|
me.secureBoot.enable = true;
|
||||||
|
|
||||||
# Early KMS
|
# Early KMS
|
||||||
|
@ -10,27 +10,10 @@
|
|||||||
|
|
||||||
config = lib.mkMerge [
|
config = lib.mkMerge [
|
||||||
{ }
|
{ }
|
||||||
(lib.mkIf (!config.me.buildingIso) {
|
(lib.mkIf (!config.me.optimizations.enable) {
|
||||||
nix.settings.system-features = lib.mkForce [
|
boot.kernelPackages = pkgs.linuxPackagesFor pkgs.linux_6_14;
|
||||||
"gccarch-znver4"
|
})
|
||||||
"gccarch-skylake"
|
(lib.mkIf (config.me.optimizations.enable) {
|
||||||
# "gccarch-alderlake" missing WAITPKG
|
|
||||||
"gccarch-x86-64-v3"
|
|
||||||
"gccarch-x86-64-v4"
|
|
||||||
"benchmark"
|
|
||||||
"big-parallel"
|
|
||||||
"kvm"
|
|
||||||
"nixos-test"
|
|
||||||
];
|
|
||||||
|
|
||||||
# Keep ALL dependencies so we can rebuild offline. This DRASTICALLY increase disk usage, but disk space is cheap.
|
|
||||||
# system.includeBuildDependencies = true;
|
|
||||||
|
|
||||||
nix.extraOptions = ''
|
|
||||||
keep-outputs = true
|
|
||||||
keep-derivations = true
|
|
||||||
'';
|
|
||||||
|
|
||||||
nixpkgs.hostPlatform = {
|
nixpkgs.hostPlatform = {
|
||||||
gcc.arch = "znver4";
|
gcc.arch = "znver4";
|
||||||
gcc.tune = "znver4";
|
gcc.tune = "znver4";
|
||||||
@ -103,8 +86,41 @@
|
|||||||
|
|
||||||
boot.kernelPackages = pkgs.linuxPackagesFor pkgs.linux_me;
|
boot.kernelPackages = pkgs.linuxPackagesFor pkgs.linux_me;
|
||||||
})
|
})
|
||||||
|
(lib.mkIf (!config.me.buildingIso) {
|
||||||
|
nix.settings.system-features = lib.mkForce [
|
||||||
|
"gccarch-znver4"
|
||||||
|
"gccarch-skylake"
|
||||||
|
# "gccarch-alderlake" missing WAITPKG
|
||||||
|
"gccarch-x86-64-v3"
|
||||||
|
"gccarch-x86-64-v4"
|
||||||
|
"benchmark"
|
||||||
|
"big-parallel"
|
||||||
|
"kvm"
|
||||||
|
"nixos-test"
|
||||||
|
];
|
||||||
|
|
||||||
|
# Keep ALL dependencies so we can rebuild offline. This DRASTICALLY increase disk usage, but disk space is cheap.
|
||||||
|
# system.includeBuildDependencies = true;
|
||||||
|
|
||||||
|
# This also should enable building offline? TODO: test.
|
||||||
|
nix.extraOptions = ''
|
||||||
|
keep-outputs = true
|
||||||
|
keep-derivations = true
|
||||||
|
'';
|
||||||
|
|
||||||
|
# # building ON
|
||||||
|
# nixpkgs.localSystem = { system = "aarch64-linux"; };
|
||||||
|
# # building FOR
|
||||||
|
# nixpkgs.crossSystem = { system = "aarch64-linux"; };
|
||||||
|
|
||||||
|
# nixpkgs.config = {
|
||||||
|
# replaceStdenv = ({ pkgs }: pkgs.clangStdenv);
|
||||||
|
# };
|
||||||
|
# or maybe an overlay
|
||||||
|
# stdenv = prev.clangStdenv;
|
||||||
|
|
||||||
|
})
|
||||||
(lib.mkIf (config.me.buildingIso) {
|
(lib.mkIf (config.me.buildingIso) {
|
||||||
boot.kernelPackages = pkgs.linuxPackagesFor pkgs.linux_6_14;
|
|
||||||
boot.supportedFilesystems.zfs = true;
|
boot.supportedFilesystems.zfs = true;
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
time.timeZone = "America/New_York";
|
time.timeZone = "America/New_York";
|
||||||
i18n.defaultLocale = "en_US.UTF-8";
|
i18n.defaultLocale = "en_US.UTF-8";
|
||||||
|
|
||||||
|
me.optimizations.enable = true;
|
||||||
me.secureBoot.enable = true;
|
me.secureBoot.enable = true;
|
||||||
|
|
||||||
# Early KMS
|
# Early KMS
|
||||||
|
@ -10,46 +10,16 @@
|
|||||||
|
|
||||||
config = lib.mkMerge [
|
config = lib.mkMerge [
|
||||||
{ }
|
{ }
|
||||||
(lib.mkIf (!config.me.buildingIso) {
|
(lib.mkIf (!config.me.optimizations.enable) {
|
||||||
nix.settings.system-features = lib.mkForce [
|
boot.kernelPackages = pkgs.linuxPackagesFor pkgs.linux_6_14;
|
||||||
"gccarch-znver4"
|
})
|
||||||
"gccarch-znver5"
|
(lib.mkIf (config.me.optimizations.enable) {
|
||||||
"gccarch-skylake"
|
|
||||||
# "gccarch-alderlake" missing WAITPKG
|
|
||||||
"gccarch-x86-64-v3"
|
|
||||||
"gccarch-x86-64-v4"
|
|
||||||
"benchmark"
|
|
||||||
"big-parallel"
|
|
||||||
"kvm"
|
|
||||||
"nixos-test"
|
|
||||||
];
|
|
||||||
|
|
||||||
# Keep ALL dependencies so we can rebuild offline. This DRASTICALLY increase disk usage, but disk space is cheap.
|
|
||||||
# system.includeBuildDependencies = true;
|
|
||||||
|
|
||||||
# This also should enable building offline? TODO: test.
|
|
||||||
nix.extraOptions = ''
|
|
||||||
keep-outputs = true
|
|
||||||
keep-derivations = true
|
|
||||||
'';
|
|
||||||
|
|
||||||
nixpkgs.hostPlatform = {
|
nixpkgs.hostPlatform = {
|
||||||
gcc.arch = "znver5";
|
gcc.arch = "znver5";
|
||||||
gcc.tune = "znver5";
|
gcc.tune = "znver5";
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
};
|
};
|
||||||
|
|
||||||
# # building ON
|
|
||||||
# nixpkgs.localSystem = { system = "aarch64-linux"; };
|
|
||||||
# # building FOR
|
|
||||||
# nixpkgs.crossSystem = { system = "aarch64-linux"; };
|
|
||||||
|
|
||||||
# nixpkgs.config = {
|
|
||||||
# replaceStdenv = ({ pkgs }: pkgs.clangStdenv);
|
|
||||||
# };
|
|
||||||
# or maybe an overlay
|
|
||||||
# stdenv = prev.clangStdenv;
|
|
||||||
|
|
||||||
nixpkgs.overlays = [
|
nixpkgs.overlays = [
|
||||||
(
|
(
|
||||||
final: prev:
|
final: prev:
|
||||||
@ -110,8 +80,42 @@
|
|||||||
|
|
||||||
boot.kernelPackages = pkgs.linuxPackagesFor pkgs.linux_me;
|
boot.kernelPackages = pkgs.linuxPackagesFor pkgs.linux_me;
|
||||||
})
|
})
|
||||||
|
(lib.mkIf (!config.me.buildingIso) {
|
||||||
|
nix.settings.system-features = lib.mkForce [
|
||||||
|
"gccarch-znver4"
|
||||||
|
"gccarch-znver5"
|
||||||
|
"gccarch-skylake"
|
||||||
|
# "gccarch-alderlake" missing WAITPKG
|
||||||
|
"gccarch-x86-64-v3"
|
||||||
|
"gccarch-x86-64-v4"
|
||||||
|
"benchmark"
|
||||||
|
"big-parallel"
|
||||||
|
"kvm"
|
||||||
|
"nixos-test"
|
||||||
|
];
|
||||||
|
|
||||||
|
# Keep ALL dependencies so we can rebuild offline. This DRASTICALLY increase disk usage, but disk space is cheap.
|
||||||
|
# system.includeBuildDependencies = true;
|
||||||
|
|
||||||
|
# This also should enable building offline? TODO: test.
|
||||||
|
nix.extraOptions = ''
|
||||||
|
keep-outputs = true
|
||||||
|
keep-derivations = true
|
||||||
|
'';
|
||||||
|
|
||||||
|
# # building ON
|
||||||
|
# nixpkgs.localSystem = { system = "aarch64-linux"; };
|
||||||
|
# # building FOR
|
||||||
|
# nixpkgs.crossSystem = { system = "aarch64-linux"; };
|
||||||
|
|
||||||
|
# nixpkgs.config = {
|
||||||
|
# replaceStdenv = ({ pkgs }: pkgs.clangStdenv);
|
||||||
|
# };
|
||||||
|
# or maybe an overlay
|
||||||
|
# stdenv = prev.clangStdenv;
|
||||||
|
|
||||||
|
})
|
||||||
(lib.mkIf (config.me.buildingIso) {
|
(lib.mkIf (config.me.buildingIso) {
|
||||||
boot.kernelPackages = pkgs.linuxPackagesFor pkgs.linux_6_14;
|
|
||||||
boot.supportedFilesystems.zfs = true;
|
boot.supportedFilesystems.zfs = true;
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
|
@ -9,7 +9,12 @@
|
|||||||
imports = [ ];
|
imports = [ ];
|
||||||
|
|
||||||
options.me = {
|
options.me = {
|
||||||
|
optimizations.enable = lib.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
default = false;
|
||||||
|
example = true;
|
||||||
|
description = "Whether we want to enable CPU optimizations (will trigger a rebuild from source).";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# options.me.graphics_card_type = lib.mkOption {
|
# options.me.graphics_card_type = lib.mkOption {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user