INNER CODE UNIT · Rust
plan
DeterminateSystems/nix-installer · src/action/common/configure_determinate_nixd_init_service/mod.rs:37
pub async fn plan(
init: InitSystem,
start_daemon: bool,
) -> Result<StatefulAction<Self>, ActionError> {
let service_dest: Option<PathBuf> = match init {
InitSystem::Launchd => {
// NOTE(cole-h): if the upstream daemon exists and we're installing determinate-
// nixd, we need to remove the old daemon unit -- we used to have a bug[1] where
// these service files wouldn't get removed, so we can't rely on them not being
// there after phase 1 of the uninstall
// [1]: https://github.com/DeterminateSystems/nix-installer/pull/1266
crate::util::remove_file(
Path::new(super::configure_upstream_init_service::DARWIN_NIX_DAEMON_DEST),
OnMissing::Ignore,
)
.await
.map_err(|e| {
Self::error(ActionErrorKind::Remove(