[General+Nix] Add x86 level support and expose this in nix system-features

This commit is contained in:
Antoine Viallon 2023-04-16 19:32:50 +02:00
parent 7b223a9a32
commit 6c4ce14a5c
Signed by: aviallon
GPG key ID: 186FC35EDEB25716
2 changed files with 19 additions and 2 deletions

View file

@ -38,7 +38,12 @@ in
};
arch = mkOption {
default = "x86-64";
default =
if cfg.cpu.x86.level >= 2 then
"x86-64-v${toString cfg.cpu.x86.level}"
else
"x86-64"
;
example = "x86-64-v2";
description = "Set CPU arch used in overlays, ...";
type = types.str;
@ -49,6 +54,15 @@ in
description = "Set CPU tuning for compilers";
type = types.str;
};
x86 = {
level = mkOption {
default = 1;
example = 3;
description = "Set supported x86-64 level";
type = with types; addCheck int (n: n >= 1 && n <= 4);
};
};
};
unsafeOptimizations = mkEnableOption "unsafe system tuning";
debug = mkEnableOption "debug-specific configuration";