I think you're looking for this:
ggplot(df, aes(y=name, x=value, fill = cost)) +
coord_cartesian(clip = "off") +
geom_bar(position = "stack", stat = "identity") +
geom_text(
aes(label = after_stat(x), group = name),
stat = 'summary', fun = sum, hjust = -0.5
)