Initial commit

This commit is contained in:
2025-08-20 18:24:02 +03:00
commit 2dec42d487
116 changed files with 6591 additions and 0 deletions

41
modules/n/hardware.nix Normal file
View File

@@ -0,0 +1,41 @@
{ lib, config, ... }:
with lib;
let
cfg = config.n.host.hardware;
in {
options.n.host.hardware = {
cpu = mkOption { type = types.str; default = ""; };
};
config = mkMerge [
(mkIf (cfg.cpu == "amd")
{
boot.kernelModules = [ "kvm-amd" ];
hardware.cpu.amd.updateMicrocode = true;
}
)
(mkIf (cfg.cpu == "intel")
{
hardware.cpu.intel.updateMicrocode = true;
}
)
(mkIf (cfg.cpu == "virt")
{
boot.initrd.availableKernelModules = [
"virtio_net"
"virtio_pci"
"virtio_mmio"
"virtio_blk"
"virtio_scsi"
"9p"
"9pnet_virtio"
];
boot.initrd.kernelModules = [
"virtio_balloon"
"virtio_console"
"virtio_rng"
"virtio_gpu"
];
}
)
];
}