+class SymlinkSearchPath(NamedTuple):
+ path: str
+
+ # pylint: disable=no-self-use
+ def pin(self, _: Verification, __: Optional[Pin]) -> SymlinkPin:
+ return SymlinkPin()
+
+ def fetch(self, v: Verification, _: Pin) -> str:
+ with tempfile.TemporaryDirectory() as td:
+ archive_filename = os.path.join(td, 'link.tar.gz')
+ os.symlink(self.path, os.path.join(td, 'link'))
+ with tarfile.open(archive_filename, mode='x:gz') as t:
+ t.add(os.path.join(td, 'link'), arcname='link')
+ return copy_to_nix_store(v, archive_filename)
+
+
+class GitSearchPath(NamedTuple):
+ git_ref: str
+ git_repo: str
+
+ def pin(self, v: Verification, old_pin: Optional[Pin]) -> GitPin:
+ if old_pin is not None:
+ assert isinstance(old_pin, GitPin)
+ old_revision = old_pin.git_revision if old_pin is not None else None
+
+ new_revision = git_fetch(v, self, None, old_revision)
+ return GitPin(release_name=git_revision_name(v, self, new_revision),
+ git_revision=new_revision)
+
+ def fetch(self, v: Verification, pin: Pin) -> str:
+ assert isinstance(pin, GitPin)
+ ensure_git_rev_available(v, self, pin, None)
+ return git_get_tarball(v, self, pin)
+
+
+class ChannelSearchPath(NamedTuple):