use super::{UnitSpec, UNITS};
pub fn find(name: &str) -> Option<&'static UnitSpec> {
let stem = name.strip_suffix(".service").unwrap_or(name);
UNITS.iter().find(|u| u.stem() == stem)
}
pub fn supervised() -> impl Iterator<Item = &'static UnitSpec> {
UNITS.iter().filter(|u| u.category.is_some())
}
pub fn net_daemon_owns_wifi(profile: &str) -> bool {
let profile = profile.replace('-', "_");
find("ados-uplink-router").is_some_and(|u| u.on_profile(&profile))
}
pub fn units_for_profile(profile: &str) -> impl Iterator<Item = &'static UnitSpec> + '_ {
UNITS.iter().filter(move |u| u.on_profile(profile))
}