{ lib, modulesPath, ... }: # Only used by the guest's own /etc/nixos flake. The bootstrap image gets its # partitioning and bootloader from nixos-generators instead, which is why # this is kept out of common.nix. # # VERIFY THE LABELS on first boot with `lsblk -f`. nixos-generators names the # root partition "nixos" and the ESP "ESP", but check rather than trust, and # fix here if they differ. Getting this wrong means the first self-rebuild # produces a system that will not boot. { imports = [ (modulesPath + "/profiles/qemu-guest.nix") ]; fileSystems."/" = { device = "/dev/disk/by-label/nixos"; fsType = "ext4"; }; fileSystems."/boot" = { device = "/dev/disk/by-label/ESP"; fsType = "vfat"; options = [ "fmask=0077" "dmask=0077" ]; }; boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = false; boot.initrd.availableKernelModules = [ "virtio_pci" "virtio_blk" "virtio_scsi" "ahci" "sd_mod" "xhci_pci" ]; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; }