Inclusion of survival function in mob in partykit

how do include a survival function in the "fit" function argument. For example, could I write a function like below and include it in the "fit" argument in mob? The variable x is a continuous variable.

kmfun <- function(y, x, start = NULL, weights = NULL, offset = NULL, ..., estfun = TRUE, object = FALSE) { survvfit(Surv(time, status) ~1, ...)}

mob_km_tree <- mob(Surv(time, status) ~ 1 | x, data = data1, fit = kmfun)

Hi, could you add a reproducible example, called a reprex?