nixos/tips/test_on_vm.md
Florian RICHER 4e8b840830
All checks were successful
check / check (push) Successful in 28s
Add tips
2024-06-29 11:07:30 +02:00

530 B

Configure VM

Configure VM

users.users.<user>.initialPassword = "<password>";
virtualisation.vmVariant = {
  # following configuration is added only when building VM with build-vm
  virtualisation = {
    memorySize = <RAM in MiB>; # Use 8192MiB memory.
    cores = <CPU Core number>;
    # And more here https://github.com/NixOS/nixpkgs/blob/nixos-unstable/nixos/modules/virtualisation/qemu-vm.nix
  };
};

Build

nixos-rebuild build-vm --flake .#nixos-test

Run

./result/bin/run-nixos-vm-vm