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