Source code for nix_daemon_protocol.collect_garbage
"""CollectGarbage operation — WireRequest/WireResponse types."""
from __future__ import annotations
from typing import ClassVar
from .protocol import GCAction
from .store_path import StorePath
from .wire_message import WireField
from .wire_ops import WireRequest, WireResponse
[docs]
class CollectGarbageResponse(WireResponse):
"""CollectGarbage response — paths deleted + bytes freed."""
paths_deleted: set[StorePath] = WireField(default_factory=set)
bytes_freed: int
obsolete: int
[docs]
class CollectGarbageRequest(WireRequest):
"""CollectGarbage request — action, paths, and GC options."""
op: ClassVar[int] = 20
response_type = CollectGarbageResponse
action: GCAction
paths_to_delete: set[StorePath] = WireField(default_factory=set)
ignore_liveness: int
max_freed: int
obsolete1: int
obsolete2: int
obsolete3: int