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

abinfo "Writing 80-aosc-os-wsl.preset ..."
cat > "$PKGDIR"/usr/lib/systemd/system-preset/80-aosc-os-wsl.preset << EOF
## 80-aosc-os-wsl.preset
## Systemd unit preset for AOSC OS on WSL distributions.

# Scheduled tasks
enable fcron.service
enable fstrim.timer
enable wsl-drop-caches.timer
enable fc-cache.service

# SSH daemon
enable sshd.service

# https://learn.microsoft.com/en-us/windows/wsl/build-custom-distro#wsl-custom-linux-distribution-recommendations
disable systemd-resolved.service
disable systemd-networkd.service
disable NetworkManager.service
disable systemd-tmpfiles-setup.service
disable systemd-tmpfiles-clean.service
disable systemd-tmpfiles-clean.timer
disable systemd-tmpfiles-setup-dev-early.service
disable systemd-tmpfiles-setup-dev.service
disable tmp.mount

# https://github.com/microsoft/WSL/blob/cbc6694cf5712426918bd82569085e2fa2e1cefd/distributions/validate-modern.py#L26C30-L26C66
disable systemd-networkd-wait-online.service

EOF
