Or like so:
when defined(linux):
...
elif defined(windows):
...
elif defined(macosx):
...
elif defined(bsd):
...
I made a Stack Overflow answer to this almost the same question with basically the same answers: https://stackoverflow.com/questions/74320430/getting-hardware-info-in-nim-lang/74332136#74332136
Please use a good search engine before posting. Why is there almost no Nim developer that uses Stack Overflow?
On Linux, the file /etc/os-release can be helpful in most cases.
On Linux, the file /etc/os-release can be helpful in most cases
According to the SE post, these are distros shipped with systemd.
Please use a good search engine before posting.
Sorry, I have been quite harsh here. You asked for operating system information contrarily to the SO post asking for hardware information.