mkdir -pv "$PKGDIR"/usr/lib/systemd/system-preset

abinfo "Writing 75-aosc-os-desktop.preset ..."
cat > "$PKGDIR"/usr/lib/systemd/system-preset/75-aosc-os-desktop.preset << EOF
## 75-aosc-os-desktop.preset
## Systemd unit preset for AOSC OS Desktop distributions.

# Device support
enable upower.service
enable udisks2.service
enable cups.service
enable saned.service
enable saned.socket

# Account managers
enable accounts-daemon.service

# Network services
enable smb.service
enable avahi-dnsconfd.service
EOF

if ab_match_arch loongarch64; then
    cat >> "$PKGDIR"/usr/lib/systemd/system-preset/75-aosc-os-desktop.preset << EOF

# LoongGPU OpenGL runtime switching service
enable loonggl-sw.service

# Fontconfig cache generation
enable fc-cache.service
EOF
fi

if ab_match_archgroup retro; then
    cat >> "$PKGDIR"/usr/lib/systemd/system-preset/75-aosc-os-desktop.preset << EOF

# XDM
enable tdm.service
EOF
fi
