Skip to content

Commit

Permalink
Bump microvm.nix to enable latest features
Browse files Browse the repository at this point in the history
Signed-off-by: Brian McGillion <[email protected]>
  • Loading branch information
brianmcgillion authored and mikatammi committed Apr 11, 2024
1 parent f5dcb09 commit 56d07af
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 30 deletions.
25 changes: 21 additions & 4 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 16 additions & 6 deletions modules/microvm/virtualization/microvm/appvm.nix
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,22 @@
];
writableStoreOverlay = lib.mkIf config.ghaf.development.debug.tools.enable "/nix/.rw-store";

qemu.extraArgs = [
"-M"
"q35,accel=kvm:tcg,mem-merge=on,sata=off"
"-device"
"vhost-vsock-pci,guest-cid=${toString cid}"
];
qemu = {
extraArgs = [
"-M"
"accel=kvm:tcg,mem-merge=on,sata=off"
"-device"
"vhost-vsock-pci,guest-cid=${toString cid}"
];

machine =
{
# Use the same machine type as the host
x86_64-linux = "q35";
aarch64-linux = "virt";
}
.${configHost.nixpkgs.hostPlatform.system};
};
};
fileSystems."/run/waypipe-ssh-public-key".options = ["ro"];

Expand Down
18 changes: 14 additions & 4 deletions modules/microvm/virtualization/microvm/guivm.nix
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,20 @@
];
writableStoreOverlay = lib.mkIf config.ghaf.development.debug.tools.enable "/nix/.rw-store";

qemu.extraArgs = [
"-device"
"vhost-vsock-pci,guest-cid=${toString cfg.vsockCID}"
];
qemu = {
extraArgs = [
"-device"
"vhost-vsock-pci,guest-cid=${toString cfg.vsockCID}"
];

machine =
{
# Use the same machine type as the host
x86_64-linux = "q35";
aarch64-linux = "virt";
}
.${configHost.nixpkgs.hostPlatform.system};
};
};

imports = [
Expand Down
12 changes: 10 additions & 2 deletions modules/microvm/virtualization/microvm/netvm.nix
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@
nixpkgs.buildPlatform.system = configHost.nixpkgs.buildPlatform.system;
nixpkgs.hostPlatform.system = configHost.nixpkgs.hostPlatform.system;

microvm.hypervisor = "qemu";

networking = {
firewall.allowedTCPPorts = [53];
firewall.allowedUDPPorts = [53];
Expand Down Expand Up @@ -88,6 +86,7 @@

microvm = {
optimize.enable = true;
hypervisor = "qemu";
shares = [
{
tag = "ro-store";
Expand All @@ -96,6 +95,15 @@
}
];
writableStoreOverlay = lib.mkIf config.ghaf.development.debug.tools.enable "/nix/.rw-store";
qemu = {
machine =
{
# Use the same machine type as the host
x86_64-linux = "q35";
aarch64-linux = "virt";
}
.${configHost.nixpkgs.hostPlatform.system};
};
};

imports = [../../../common];
Expand Down
30 changes: 16 additions & 14 deletions targets/lenovo-x1/guivmExtraModules.nix
Original file line number Diff line number Diff line change
Expand Up @@ -136,20 +136,22 @@
# Early KMS needed for GNOME to work inside GuiVM
boot.initrd.kernelModules = ["i915"];

microvm.qemu.extraArgs = [
# Lenovo X1 Lid button
"-device"
"button"
# Lenovo X1 battery
"-device"
"battery"
# Lenovo X1 AC adapter
"-device"
"acad"
# Connect sound device to hosts pulseaudio socket
"-audiodev"
"pa,id=pa1,server=unix:/run/pulse/native"
];
microvm.qemu = {
extraArgs = [
# Lenovo X1 Lid button
"-device"
"button"
# Lenovo X1 battery
"-device"
"battery"
# Lenovo X1 AC adapter
"-device"
"acad"
# Connect sound device to hosts pulseaudio socket
"-audiodev"
"pa,id=pa1,server=unix:/run/pulse/native"
];
};
};
in [
./sshkeys.nix
Expand Down

0 comments on commit 56d07af

Please sign in to comment.