By default, socat only waits 0.5s for the remote side to finish after getting EOF on the local side. So don't close the local side, instead wait for socat to exit when the remote side finishes. http://hydra.nixos.org/build/10663282
Nixpkgs is a collection of packages for Nix package manager. Nixpkgs also includes NixOS linux distribution source code.