anchor.diff:        };
       };
   
  -    makeLuksRootTest = name: luksFormatOpts: makeInstallerTest name
  -      { createPartitions = ''
  -          $machine->succeed(
  +    makeLuksRootTest = name: luksFormatOpts: makeInstallerTest name {
  +      createPartitions = ''
  +        machine.succeed(
               "flock /dev/vda parted --script /dev/vda -- mklabel msdos"
  -            . " mkpart primary ext2 1M 50MB" # /boot
  -            . " mkpart primary linux-swap 50M 1024M"
  -            . " mkpart primary 1024M -1s", # LUKS
  +            + " mkpart primary ext2 1M 50MB"  # /boot
  +            + " mkpart primary linux-swap 50M 1024M"
  +            + " mkpart primary 1024M -1s",  # LUKS
               "udevadm settle",
               "mkswap /dev/vda2 -L swap",
               "swapon -L swap",
  
positive.code:             "mkfs.ext3 -L boot /dev/vda1",
              "mkdir -p /mnt/boot",
              "mount LABEL=boot /mnt/boot",
            );
          '';
          extraConfig = ''
            boot.kernelParams = lib.mkAfter [ "console=tty0" ];
          '';
          enableOCR = true;
          preBootCommands = ''
            $machine->start;
            $machine->waitForText(qr/Passphrase for/);
            $machine->sendChars("supersecret\n");
          '';
        };
  
    # The (almost) simplest partitioning scheme: a swap partition and
    # one big filesystem partition.
    simple-test-config = { createPartitions =
         ''
           $machine->succeed(
               "flock /dev/vda parted --script /dev/vda -- mklabel msdos"
               . " mkpart primary linux-swap 1M 1024M"
               . " mkpart primary ext2 1024M -1s",
               "udevadm settle",
               "mkswap /dev/vda1 -L swap",
               "swapon -L swap",
               "mkfs.ext3 -L nixos /dev/vda2",
               "mount LABEL=nixos /mnt",
           );
         '';
     };
  
    simple-uefi-grub-config =
      { createPartitions =
          ''
            $machine->succeed(
                "flock /dev/vda parted --script /dev/vda -- mklabel gpt"
                . " mkpart ESP fat32 1M 50MiB" # /boot
                . " set 1 boot on"
                . " mkpart primary linux-swap 50MiB 1024MiB"
                . " mkpart primary ext2 1024MiB -1MiB", # /
                "udevadm settle",
                "mkswap /dev/vda2 -L swap",
                "swapon -L swap",
                "mkfs.ext3 -L nixos /dev/vda3",
                "mount LABEL=nixos /mnt",
                "mkfs.vfat -n BOOT /dev/vda1",
                "mkdir -p /mnt/boot",
                "mount LABEL=BOOT /mnt/boot",
            );
          '';
          bootLoader = "grub";
          grubUseEfi = true;
      };
  
    clone-test-extraconfig = { extraConfig =
           ''
           environment.systemPackages = [ pkgs.grub2 ];
           boot.loader.grub.configurationName = "Home";
           nesting.clone = [
           {
             boot.loader.grub.configurationName = lib.mkForce "Work";
  
             environment.etc = {
               "gitconfig".text = "
                 [core]
                   gitproxy = none for work.com
                   ";
             };
           }
           ];
           '';
         testCloneConfig = true;
    };
  
  
  
negative.code:   # Test whether opening encrypted filesystem with keyfile
    # Checks for regression of missing cryptsetup, when no luks device without
    # keyfile is configured
    encryptedFSWithKeyfile = makeInstallerTest "encryptedFSWithKeyfile" {
      createPartitions = ''
        machine.succeed(
            "flock /dev/vda parted --script /dev/vda -- mklabel msdos"
            + " mkpart primary ext2 1M 50MB"  # /boot
            + " mkpart primary linux-swap 50M 1024M"
            + " mkpart primary 1024M 1280M"  # LUKS with keyfile
            + " mkpart primary 1280M -1s",
            "udevadm settle",
            "mkswap /dev/vda2 -L swap",
            "swapon -L swap",
  