Related: https://unix.stackexchange.com/questions/65595/how-to-know-if-a-disk-is-an-ssd-or-an-hdd
IMO though. You could use the POSIX method of determining the OS, and have various methods to detect SSD, and when it can't be determined, simply ask the end-user, and if they don't know, have a safe default. I guess that is what I would do if there wasn't a POSIX compliant method (but I would probably check the POSIX mailing list first though too). I hope this helps.