sanitize_nix_env function

Sanitize nix environment string