|
|
@ -7,19 +7,17 @@
|
|
|
|
}:
|
|
|
|
}:
|
|
|
|
let
|
|
|
|
let
|
|
|
|
cfg = config.x-banananetwork.hwCommon;
|
|
|
|
cfg = config.x-banananetwork.hwCommon;
|
|
|
|
|
|
|
|
cpu = config.hardware.cpu;
|
|
|
|
in
|
|
|
|
in
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
options = {
|
|
|
|
options = {
|
|
|
|
|
|
|
|
|
|
|
|
x-banananetwork.hwCommon = {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
enable = lib.mkEnableOption ''
|
|
|
|
hardware.cpu = {
|
|
|
|
settings common to all bare hardware-based hosts
|
|
|
|
|
|
|
|
'';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cpu = lib.mkOption {
|
|
|
|
type = lib.mkOption {
|
|
|
|
description = ''
|
|
|
|
description = ''
|
|
|
|
Configures the CPU type to expect this configuration to run on
|
|
|
|
Configures the CPU type to expect this configuration to run on
|
|
|
|
'';
|
|
|
|
'';
|
|
|
@ -29,6 +27,16 @@ in
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
x-banananetwork.hwCommon = {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
enable = lib.mkEnableOption ''
|
|
|
|
|
|
|
|
settings common to all bare hardware-based hosts
|
|
|
|
|
|
|
|
'';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -41,13 +49,13 @@ in
|
|
|
|
|
|
|
|
|
|
|
|
(
|
|
|
|
(
|
|
|
|
lib.mkIf
|
|
|
|
lib.mkIf
|
|
|
|
(cfg.cpu == "amd")
|
|
|
|
(cpu.type == "amd")
|
|
|
|
{ amd.updateMicrocode = true; }
|
|
|
|
{ amd.updateMicrocode = true; }
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
(
|
|
|
|
(
|
|
|
|
lib.mkIf
|
|
|
|
lib.mkIf
|
|
|
|
(cfg.cpu == "intel")
|
|
|
|
(cpu.type == "intel")
|
|
|
|
{ intel.updateMicrocode = true; }
|
|
|
|
{ intel.updateMicrocode = true; }
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|