We analyze an adaptive mesh refinement hydrodynamic cosmological simulation of a Milky-Way-sized galaxy to study the cold gas in the halo. H I observations of the Milky Way and other nearby spirals have revealed the presence of such gas in the form of clouds and other extended structures, which indicates ongoing accretion. We use a high-resolution simulation (136-272 pc throughout) to study the distribution of cold gas in the halo, compare it with observations, and examine its origin. The amount (similar to 10(8) M-circle dot in H I), covering fraction, and spatial distribution of the cold halo gas around the simulated galaxy at z = 0 are consistent with existing observations. At z = 0, the Hi mass accretion rate onto the disk is 0.2 M-circle dot yr(-1). We track the histories of the 20 satellites that are detected in Hi in the redshift interval 0.5 > z > 0 and find that most of them are losing gas, with a median mass-loss rate per satellite of 3.1 x 10(-3) M-circle dot yr(-1). This stripped gas is a significant component of the Hi gas seen in the simulation. In addition, we see filamentary material coming into the halo from the intergalactic medium at all redshifts. Most of this gas does not make it directly to the disk, but part of the gas in these structures is able to cool and form clouds. The metallicity of the gas allows us to distinguish between filamentary flows and satellite gas. We find that the former accounts for at least 25%-75% of the cold gas in the halo seen at any redshift analyzed here. Placing constraints on cloud formation mechanisms allows us to better understand how galaxies accrete gas and fuel star formation at z = 0.