78 lines
1.5 KiB
Nix
Raw Normal View History

2025-05-25 11:55:51 +02:00
{
mkModule,
pkgs,
lib,
config,
...
}:
with lib;
let
cfg = config.modules.profiles.vm;
in
{
options.modules.profiles.vm = {
enable = mkEnableOption "Base VM profile";
};
config = mkIf cfg.enable {
# Enabled modules
modules = {
profiles.base.enable = true;
ssh.enable = true;
};
2025-05-28 13:59:30 +02:00
# Admin users
users.users.local = {
extraGroups = [ "wheel" ];
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKKxoQSxfYqf9ITN8Fhckk8WbY4dwtBAXOhC9jxihJvq jan@bulthuis.dev"
];
};
2025-05-25 11:55:51 +02:00
# Enable qemu guest agent
services.qemuGuest.enable = true;
2025-05-28 12:23:31 +02:00
# Machine platform
nixpkgs.hostPlatform = "x86_64-linux";
2025-05-25 11:55:51 +02:00
# Hardware configuration
hardware.enableRedistributableFirmware = true;
boot.initrd.availableKernelModules = [
"ata_piix"
"uhci_hcd"
"virtio_pci"
"virtio_scsi"
"sd_mod"
"sr_mod"
];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
hardware.cpu.intel.updateMicrocode = true;
# Filesystems
fileSystems."/" = {
device = "/dev/disk/by-partlabel/root";
fsType = "ext4";
};
fileSystems."/boot" = {
device = "/dev/disk/by-partlabel/EFI";
fsType = "vfat";
options = [
"fmask=0077"
"dmask=0077"
];
};
# Swapfile
swapDevices = [
{
device = "/var/lib/swapfile";
size = 6 * 1024;
}
];
};
}