anchor.diff:      destination = "/flake-registry.json";
     };
   
  -  api = pkgs.runCommand "nixpkgs-flake" {}
  +  private-flake-rev = "9f1dd0df5b54a7dc75b618034482ed42ce34383d";
  +
  +  private-flake-api = pkgs.runCommand "private-flake" {}
  +    ''
  +      mkdir -p $out/{commits,tarball}
  +
  +      # Setup https://docs.github.com/en/rest/commits/commits#get-a-commit
  +      echo '{"sha": "${private-flake-rev}"}' > $out/commits/HEAD
  +
  +      # Setup tarball download via API
  +      dir=private-flake
  +      mkdir $dir
  +      echo '{ outputs = {...}: {}; }' > $dir/flake.nix
  +      tar cfz $out/tarball/${private-flake-rev} $dir --hard-dereference
  +    '';
  +
  +  nixpkgs-api = pkgs.runCommand "nixpkgs-flake" {}
       ''
         mkdir -p $out/commits
  +
  +      # Setup https://docs.github.com/en/rest/commits/commits#get-a-commit
         echo '{"sha": "${nixpkgs.rev}"}' > $out/commits/HEAD
       '';
   
  
positive.code: 
      start_all()
  
      github.wait_for_unit("httpd.service")
  
      client.succeed("curl -v https://github.com/ >&2")
      client.succeed("nix registry list | grep nixpkgs")
  
      rev = client.succeed("nix flake info nixpkgs --json | jq -r .revision")
      assert rev.strip() == "${nixpkgs.rev}", "revision mismatch"
  
      client.succeed("nix registry pin nixpkgs")
  
      client.succeed("nix flake info nixpkgs --tarball-ttl 0 >&2")
  
      # Shut down the web server. The flake should be cached on the client.
      github.succeed("systemctl stop httpd.service")
  
      info = json.loads(client.succeed("nix flake info nixpkgs --json"))
      date = time.strftime("%Y%m%d%H%M%S", time.gmtime(info['lastModified']))
      assert date == "${nixpkgs.lastModifiedDate}", "time mismatch"
  
  
negative.code:               "owner": "NixOS",
                "repo": "nixpkgs"
              }
            },
            {
              "from": {
                "type": "indirect",
                "id": "private-flake"
              },
              "to": {
                "type": "github",
                "owner": "fancy-enterprise",
                "repo": "private-flake"
              }
            }
          ],
          "version": 2
  