Refactor home manager profile
This commit is contained in:
1 parent
63386512a8
commit
6c452c6649
10 files changed
+493
-107
No files matched your search
@@ -0,0 +1,70 @@
|
||||
{
|
||||
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 {
|
||||
# Machine hostname
|
||||
networking.hostName = lib.mkDefault "vm-base";
|
||||
|
||||
# Enabled modules
|
||||
modules = {
|
||||
profiles.base.enable = true;
|
||||
base.enable = true;
|
||||
ssh.enable = true;
|
||||
};
|
||||
|
||||
# Enable qemu guest agent
|
||||
services.qemuGuest.enable = true;
|
||||
|
||||
# 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;
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user