fix(vm): fix Plymouth theme path and optimize VM graphics for splash screen

This commit is contained in:
Bernardo Magri
2026-04-05 12:41:21 +01:00
parent 34c87d21ef
commit 2afd5eaa36
2 changed files with 6 additions and 3 deletions

View File

@@ -88,12 +88,14 @@
virtualisation.memorySize = 2048; virtualisation.memorySize = 2048;
virtualisation.cores = 2; virtualisation.cores = 2;
virtualisation.graphics = true; virtualisation.graphics = true;
virtualisation.qemu.options = [ "-vga virtio" ];
}; };
# Use a dummy hardware config for VM # Use a dummy hardware config for VM
fileSystems."/" = { device = "/dev/disk/by-label/nixos"; }; fileSystems."/" = { device = "/dev/disk/by-label/nixos"; };
boot.loader.grub.device = "/dev/vda"; boot.loader.grub.device = "/dev/vda";
boot.initrd.kernelModules = [ "virtio_gpu" ]; boot.initrd.kernelModules = [ "virtio_gpu" ];
boot.kernelParams = [ "video=1280x800" ];
# Ensure the user has the right groups for graphical environment # Ensure the user has the right groups for graphical environment
users.users.nixos = { users.users.nixos = {
@@ -121,12 +123,14 @@
virtualisation.memorySize = 2048; virtualisation.memorySize = 2048;
virtualisation.cores = 2; virtualisation.cores = 2;
virtualisation.graphics = true; virtualisation.graphics = true;
virtualisation.qemu.options = [ "-vga virtio" ];
}; };
# Use a dummy hardware config for VM # Use a dummy hardware config for VM
fileSystems."/" = { device = "/dev/disk/by-label/nixos"; }; fileSystems."/" = { device = "/dev/disk/by-label/nixos"; };
boot.loader.grub.device = "/dev/vda"; boot.loader.grub.device = "/dev/vda";
boot.initrd.kernelModules = [ "virtio_gpu" ]; boot.initrd.kernelModules = [ "virtio_gpu" ];
boot.kernelParams = [ "video=1280x800" ];
# Setup default user for testing # Setup default user for testing
users.users.nomarchy = { users.users.nomarchy = {

View File

@@ -10,9 +10,8 @@ let
installPhase = '' installPhase = ''
mkdir -p $out/share/plymouth/themes/nomarchy mkdir -p $out/share/plymouth/themes/nomarchy
cp * $out/share/plymouth/themes/nomarchy/ cp * $out/share/plymouth/themes/nomarchy/
# Fix path in the plymouth file to point to the nix store if needed, # Fix path in the plymouth file to point to the nix store
# but usually Plymouth looks in its theme dir. sed -i "s|/[a-z]*/share/plymouth/themes/nomarchy|$out/share/plymouth/themes/nomarchy|g" $out/share/plymouth/themes/nomarchy/nomarchy.plymouth
sed -i "s|/etc/plymouth/themes/nomarchy|$out/share/plymouth/themes/nomarchy|g" $out/share/plymouth/themes/nomarchy/nomarchy.plymouth
''; '';
}; };
in in