commonrc: Better PATH handling and adding nix

    Also make some changes recommended by shellcheck.net