nixpkgs/nixos/modules/virtualisation
Bjørn Forsman 39fad297fd nixos: fix "nixos-rebuild build-vm-with-bootloader" for EFI systems
`nixos-rebuild build-vm-with-bootloader` currently fails with the
default NixOS EFI configuration:

  $ cat >configuration.nix <<EOF
  {
    fileSystems."/".device = "/dev/sda1";
    boot.loader.systemd-boot.enable = true;
    boot.loader.efi.canTouchEfiVariables = true;
  }
  EOF

  $ nixos-rebuild build-vm-with-bootloader -I nixos-config=$PWD/configuration.nix -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/nixos-20.09.tar.gz
  [...]
  insmod: ERROR: could not insert module /nix/store/1ibmgfr13r8b6xyn4f0wj115819f359c-linux-5.4.83/lib/modules/5.4.83/kernel/fs/efivarfs/efivarfs.ko.xz: No such device
  mount: /sys/firmware/efi/efivars: mount point does not exist.
  [    1.908328] reboot: Power down
  builder for '/nix/store/dx2ycclyknvibrskwmii42sgyalagjxa-nixos-boot-disk.drv' failed with exit code 32
  [...]

Fix it by setting virtualisation.useEFIBoot = true in qemu-vm.nix, when
efi is needed.

And remove the now unneeded configuration in
./nixos/tests/systemd-boot.nix, since it's handled globally.

Before:
* release-20.03: successful build, unsuccessful run
* release-20.09 (and master): unsuccessful build

After:
* Successful build and run.

Fixes https://github.com/NixOS/nixpkgs/issues/107255
2020-12-21 08:55:13 +01:00
..
amazon-image.nix utillinux: rename to util-linux 2020-11-24 12:42:06 -05:00
amazon-init.nix nixos/amazon-init.nix: Add gzip to amazon-init path 2020-01-23 14:15:26 +01:00
amazon-options.nix amazon-image.nix: add EFI support, enable by default for aarch64 2019-09-05 00:52:17 +09:00
anbox.nix nixos/modules: Remove all usages of types.string 2019-08-31 18:19:00 +02:00
azure-agent-entropy.patch
azure-agent.nix utillinux: rename to util-linux 2020-11-24 12:42:06 -05:00
azure-bootstrap-blobs.nix
azure-common.nix azure: boot.growPartition = true 2020-03-29 13:56:55 -07:00
azure-config-user.nix [bot] nixos/*: remove unused arguments in lambdas 2018-07-20 20:56:59 +00:00
azure-config.nix [bot] nixos/*: remove unused arguments in lambdas 2018-07-20 20:56:59 +00:00
azure-image.nix nixos/modules: remove trailing whitespace 2020-08-07 14:45:39 +01:00
azure-images.nix
brightbox-config.nix [bot] nixos/*: remove unused arguments in lambdas 2018-07-20 20:56:59 +00:00
brightbox-image.nix utillinux: rename to util-linux 2020-11-24 12:42:06 -05:00
cloudstack-config.nix treewide: remove unused variables (#63177) 2019-06-16 19:59:05 +00:00
container-config.nix nixos containers: disable NixOS manual in container config. (#75659) 2019-12-15 18:21:52 +02:00
containers.nix nixos/{containers,cri-o,podman}: move copyFile to nixos/lib/utils 2020-09-24 10:01:47 +10:00
cri-o.nix nixos/{containers,cri-o,podman}: move copyFile to nixos/lib/utils 2020-09-24 10:01:47 +10:00
digital-ocean-config.nix nixos/digital-ocean-image: init 2019-11-24 08:11:33 -08:00
digital-ocean-image.nix nixos/digital-ocean-image: init 2019-11-24 08:11:33 -08:00
digital-ocean-init.nix nixos/digital-ocean-image: init 2019-11-24 08:11:33 -08:00
docker-image.nix nixos/docker-image: add example usage 2018-11-23 15:40:10 +00:00
docker.nix systemd: switch to unified cgroup hierarchy by default 2020-11-19 16:56:46 +01:00
ec2-amis.nix ec2-amis: update AMIs to use gpt partition table 2020-11-05 20:58:08 -05:00
ec2-data.nix nixos/treewide: Move rename.nix imports to their respective modules 2019-12-10 02:51:19 +01:00
ec2-metadata-fetcher.nix {ec2,openstack}-metadata-fetcher: unconditionally fetch metadata 2020-11-22 11:04:46 +10:00
ecs-agent.nix nixos/*: use $out instead of $bin with buildGoPackage 2020-04-28 20:30:29 +10:00
gce-images.nix Update GCE image for 18.09 2018-11-16 11:43:42 +01:00
google-compute-config.nix google-compute-config.nix: use sysctl snippets from gce 2019-09-01 02:55:28 +02:00
google-compute-image.nix treewide: Remove usage of isNull 2019-04-29 14:05:50 +02:00
grow-partition.nix nixos: introduce boot.growPartition (#33521) 2018-01-06 13:52:51 +00:00
hyperv-guest.nix nixos/virtualisation.hypervGuest: use elevator=noop 2020-02-09 19:50:13 +01:00
hyperv-image.nix virtualisation/hyperv-image: remove diskImage after vhdx is generated 2020-05-20 19:56:38 -04:00
kvmgt.nix nixos/kvmgt: allow multiple uuids on same mdev 2020-05-30 12:13:54 -04:00
libvirtd.nix libvirtd: don't start libvirtd-tcp.socket by default 2020-07-08 19:50:23 -04:00
lxc-container.nix [bot] nixos/*: remove unused arguments in lambdas 2018-07-20 20:56:59 +00:00
lxc.nix Revert "apparmor: fix and improve the service" 2020-10-07 12:22:18 +02:00
lxcfs.nix lxcfs: remove cgmanager dependency 2017-11-07 11:04:12 +00:00
lxd.nix Revert "apparmor: fix and improve the service" 2020-10-07 12:22:18 +02:00
nixos-containers.nix nixos/*: fix indentation 2020-11-23 08:42:51 +10:00
oci-containers.nix nixos/docker-containers: Rename to virtualisation.oci-containers.containers. 2020-05-04 13:47:25 +01:00
openstack-config.nix nixos: openstack: have its own metadata fetcher expression 2020-11-18 11:42:32 -05:00
openstack-metadata-fetcher.nix {ec2,openstack}-metadata-fetcher: unconditionally fetch metadata 2020-11-22 11:04:46 +10:00
openvswitch.nix openvswitch: better integration with systemd 2019-12-15 21:16:26 +01:00
parallels-guest.nix treewide: fix modules options types where the default is null 2020-04-28 19:13:59 +02:00
podman.nix nixos/{containers,cri-o,podman}: move copyFile to nixos/lib/utils 2020-09-24 10:01:47 +10:00
qemu-guest-agent.nix nixos/qemu-guest-agent: make the QEMU guest agent package configurable 2020-10-19 17:58:10 +02:00
qemu-vm.nix nixos: fix "nixos-rebuild build-vm-with-bootloader" for EFI systems 2020-12-21 08:55:13 +01:00
railcar.nix treewide: completely remove types.loaOf 2020-09-02 00:42:50 +02:00
spice-usb-redirection.nix fixup: address @jtojnar's review comments 2020-09-12 17:00:44 +02:00
vagrant-guest.nix nixos/vagrant-virtualbox-image: init (#101120) 2020-10-20 11:09:46 +02:00
vagrant-virtualbox-image.nix nixos/vagrant-virtualbox-image: init (#101120) 2020-10-20 11:09:46 +02:00
virtualbox-guest.nix nixos/virtualbox-guest: add vmware driver 2020-06-17 18:43:27 +02:00
virtualbox-host.nix nixos/virtualbox: fix systemd-networkd-wait-online.service waiting for vboxnet0 2019-10-26 00:45:42 +02:00
virtualbox-image.nix Merge pull request #60246 from dfordivam/virtualbox-add-extra-disk 2020-08-02 13:13:52 -04:00
vmware-guest.nix nixos/treewide: Move rename.nix imports to their respective modules 2019-12-10 02:51:19 +01:00
vmware-image.nix virtualisation: add vmware-image (#88523) 2020-05-22 10:03:46 +02:00
xe-guest-utilities.nix nixos: correct improper uses of mkEnableOption, clarify service descriptions 2018-10-05 13:14:45 +07:00
xen-dom0.nix utillinux: rename to util-linux 2020-11-24 12:42:06 -05:00
xen-domU.nix [bot] nixos/*: remove unused arguments in lambdas 2018-07-20 20:56:59 +00:00