Cleaned up some stuff

This commit is contained in:
Erwin Boskma 2021-10-07 09:59:54 +02:00
parent 956a0e3bbc
commit 872c0b719d
Signed by: erwin
GPG key ID: 02C3C0D914C0012B
3 changed files with 33 additions and 52 deletions

View file

@ -30,15 +30,23 @@
system = "x86_64-linux";
nixosConfig = {
vm1BiosConfig = {
boot = {
type = "qemu-bios";
type = "bios";
qemu = true;
grubInstallDevice = "/dev/vda";
};
core.enable = true;
};
vm1UefiConfig = {
boot = {
type = "uefi";
qemu = true;
};
core.enable = true;
};
vm2Config = {
boot = {
type = "uefi";
@ -76,22 +84,10 @@
name = "vm1";
NICs = [ "enp1s0" ];
kernelPackage = pkgs.linuxPackages;
initrdMods = [
"ahci"
"xhci_pci"
"virtio_pci"
"sr_mod"
"virtio_blk"
"virtio_net"
"virtio_mmio"
"virtio_scsi"
"9p"
"9pnet_virtio"
];
kernelMods =
[ "kvm-amd" "virtio_balloon" "virtio_console" "virtio_rng" ];
initrdMods = [ "ahci" "xhci_pci" "sr_mod" ];
kernelMods = [ "kvm-amd" ];
kernelParams = [ ];
systemConfig = nixosConfig;
systemConfig = vm1UefiConfig;
users = nixosUsers;
@ -102,20 +98,8 @@
name = "vm2";
NICs = [ "enp1s0" ];
kernelPackage = pkgs.linuxPackages;
initrdMods = [
"ahci"
"xhci_pci"
"virtio_pci"
"sr_mod"
"virtio_blk"
"virtio_net"
"virtio_mmio"
"virtio_scsi"
"9p"
"9pnet_virtio"
];
kernelMods =
[ "kvm-amd" "virtio_balloon" "virtio_console" "virtio_rng" ];
initrdMods = [ "ahci" "xhci_pci" "sr_mod" ];
kernelMods = [ "kvm-amd" ];
kernelParams = [ ];
systemConfig = vm2Config;
@ -124,13 +108,13 @@
cpuCores = 4;
};
loki = host.mkHost {
name = "loki";
NICs = [ "enp4s0" ];
kernelPackage = pkgs.linuxPackages;
initrdMods = [ "nvme" "xhci_pci" "ahci" ];
kernelMods = [ "kvm-amd" ];
};
# loki = host.mkHost {
# name = "loki";
# NICs = [ "enp4s0" ];
# kernelPackage = pkgs.linuxPackages;
# initrdMods = [ "nvme" "xhci_pci" "ahci" ];
# kernelMods = [ "kvm-amd" ];
# };
};
};
}

View file

@ -1,4 +1,4 @@
{ pkgs, config, lib, ... }:
{ pkgs, config, lib, modulesPath, ... }:
with lib;
let cfg = config.eb.boot;
@ -70,12 +70,14 @@ in {
};
})
(mkIf (cfg.qemu) {
boot.initrd.postDeviceCommands = ''
# Set the system time from the hardware clock to work around a
# bug in qemu-kvm > 1.5.2 where the VM clock is initialized
# to the *boot time* of the host.
boot.initrd = {
availableKernelModules = [ "virtio_net" "virtio_pci" "virtio_mmio" "virtio_blk" "virtio_scsi" "9p" "9pnet_virtio" ];
kernelModules = [ "virtio_balloon" "virtio_console" "virtio_rng" ];
postDeviceCommands =
''
hwclock -s
'';
};
services.qemuGuest.enable = true;
})

View file

@ -1,8 +1,3 @@
{ pkgs, config, lib, ... }:
{
imports = [
./boot
./core
./nixos
];
{ pkgs, config, lib, modulesPath, ... }: {
imports = [ ./boot ./core ./nixos ];
}