[Unit]
Description=Clean up modules from old kernels
[Service]
Type=oneshot
ExecStart=/bin/bash -exc 'for i in /usr/lib/modules/[0-9]*; do if [[ $${i##*/} = \'%v\' ]] || pacman -Qo "$${i}"; then continue; fi; mv "$${i}" /usr/lib/modules/.old/; done'
[Install]
WantedBy=basic.target