refactor(nixos): move hardware config options to machine nixos module
This commit is contained in:
parent
91c2790b62
commit
8165d96d7c
15 changed files with 70 additions and 84 deletions
21
modules/nixos/machine/platform/default.nix
Normal file
21
modules/nixos/machine/platform/default.nix
Normal file
|
@ -0,0 +1,21 @@
|
|||
{ config, lib, ... }:
|
||||
let
|
||||
inherit (lib) singleton mkOption;
|
||||
inherit (lib.types) enum;
|
||||
cfg = config.machine.platform;
|
||||
in
|
||||
{
|
||||
options.machine.platform = {
|
||||
type = mkOption {
|
||||
type = enum [
|
||||
"amd"
|
||||
"intel"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
hardware.cpu.${cfg.type}.updateMicrocode = true;
|
||||
boot.kernelModules = singleton "kvm-${cfg.type}";
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue