anchor.diff:  
         # We need to a writable nix-store on next boot.
         $machine->copyFileFromHost(
  -          "${ makeConfig { inherit grubVersion grubDevice grubIdentifier extraConfig; readOnly = false; forceGrubReinstallCount = 1; } }",
  +          "${ makeConfig { inherit grubVersion grubDevice grubIdentifier extraConfig; forceGrubReinstallCount = 1; } }",
             "/etc/nixos/configuration.nix");
   
         # Check whether nixos-rebuild works.
  
positive.code: 
    # The configuration to install.
    makeConfig = { grubVersion, grubDevice, grubIdentifier
                 , extraConfig, readOnly ? true, forceGrubReinstallCount ? 0
                 }:
      pkgs.writeText "configuration.nix" ''
        { config, lib, pkgs, modulesPath, ... }:
  
negative.code:       ${preBootCommands}
        $machine->waitForUnit("multi-user.target");
        $machine->copyFileFromHost(
            "${ makeConfig { inherit grubVersion grubDevice grubIdentifier extraConfig; forceGrubReinstallCount = 2; } }",
            "/etc/nixos/configuration.nix");
        $machine->succeed("nixos-rebuild boot >&2");
        $machine->shutdown;
  