fixed nix stuff still utnested thought

* corection on D.CloseFd declare
* fixed a bnch D. in nix stuff
* making nix stuff rely on ostypes
* created returnFirstLibThatOpens
* UNTESTED