It was a little hard to find any rules about citizens outside EU...so I contacted Ken Stråhle at the Värmland regional authority...
He told me that there are actually no limitations if you buy a normal house that is not a farm or has forests. We have a central register (fastighetsboken = Property book) where the designation, owner, type of property, "easements" etc are registered. You just buy it and then register...if its a house coded as Type 2XX.
(codes in Swedish but its good to have them: https://www.skatteverket.se/foretagochorganisationer/skatter/fastighet/fastighetstaxering/typkoder.4.3f4496fd14864cc5ac9126d.html)
Generally speaking the idea is that also farmhouses should be seperated as a differnt property (type 2XX) from the agricultural property (type 1XX) but in most cases farmers don't do it as then the house could benefit from being part of the "business" and cost to fix the house could be paid by income on the farming busienss. But if you are interested in a house coded as 1XX it could be possible with a permit.
An interested thing is that only areas classified as rural area has normally some limitation if a anyone tryies to buy a house coded 1xx. Some part of the community is often seen as non rural ...and then it should not be a problem what so ever but if you are intrested in an object marked as rural and its registered as agricultureal property...you need to check.
You normally don't need to bother about a permit. If the house has the code 2XX...no problem
If you like a farm house coded as 1XX...well if its in rural area you need a permit but not if its in an area marked as non rural...