def rpm_nspawn_plugins(*, opts: _NspawnOpts, plugin_args: NspawnPluginArgs) -> Iterable[NspawnPlugin]:
    serve_rpm_snapshots = set(plugin_args.serve_rpm_snapshots)
    shadow_paths = [*plugin_args.shadow_paths]
    default_snapshot_dir = _get_snapshot_dir(opts, plugin_args)
    shadow_paths_allow_unmatched = []
    if (plugin_args.shadow_proxied_binaries and (opts.user.pw_name == 'root') and default_snapshot_dir.exists()):
        for prog_name in sorted(default_snapshot_dir.listdir()):
            snapshot_dir = (RPM_DEFAULT_SNAPSHOT_FOR_INSTALLER_DIR / prog_name)
            serve_rpm_snapshots.add(snapshot_dir)
            shadow_paths.append((prog_name, (((snapshot_dir / prog_name) / 'bin') / prog_name)))
            if (plugin_args.attach_antlir_dir == AttachAntlirDirMode.DEFAULT_ON):
                shadow_paths_allow_unmatched.append(prog_name)
    return (*([AttachAntlirDir()] if (((plugin_args.attach_antlir_dir == AttachAntlirDirMode.DEFAULT_ON) and (not opts.layer.path(ANTLIR_DIR).exists())) or (plugin_args.attach_antlir_dir == AttachAntlirDirMode.EXPLICIT_ON)) else []), *([ShadowPaths(shadow_paths, shadow_paths_allow_unmatched)] if shadow_paths else []), *([*([YumDnfVersionlock(plugin_args.snapshots_and_versionlocks, serve_rpm_snapshots)] if plugin_args.snapshots_and_versionlocks else []), RepoServers(serve_rpm_snapshots)] if serve_rpm_snapshots else ()))
def rpm_nspawn_plugins(*, opts: _NspawnOpts, plugin_args: NspawnPluginArgs) -> Iterable[NspawnPlugin]:
    serve_rpm_snapshots = set(plugin_args.serve_rpm_snapshots)
    shadow_paths = [*plugin_args.shadow_paths]
    default_snapshot_dir = _get_snapshot_dir(opts, plugin_args)
    shadow_paths_allow_unmatched = []
    if (plugin_args.shadow_proxied_binaries and (opts.user.pw_name == 'root') and default_snapshot_dir.exists()):
        for prog_name in sorted(default_snapshot_dir.listdir()):
            snapshot_dir = (RPM_DEFAULT_SNAPSHOT_FOR_INSTALLER_DIR / prog_name)
            serve_rpm_snapshots.add(snapshot_dir)
            shadow_paths.append((prog_name, (((snapshot_dir / prog_name) / 'bin') / prog_name)))
            if (plugin_args.attach_antlir_dir == AttachAntlirDirMode.DEFAULT_ON):
                shadow_paths_allow_unmatched.append(prog_name)
    return (*([AttachAntlirDir()] if (((plugin_args.attach_antlir_dir == AttachAntlirDirMode.DEFAULT_ON) and (not opts.layer.path(ANTLIR_DIR).exists())) or (plugin_args.attach_antlir_dir == AttachAntlirDirMode.EXPLICIT_ON)) else []), *([ShadowPaths(shadow_paths, shadow_paths_allow_unmatched)] if shadow_paths else []), *([*([YumDnfVersionlock(plugin_args.snapshots_and_versionlocks, serve_rpm_snapshots)] if plugin_args.snapshots_and_versionlocks else []), RepoServers(serve_rpm_snapshots)] if serve_rpm_snapshots else ()))