$NIXOS_CONFIG can be set to a directory, in which case the file used is $NIXOS_CONFIG/default.nix. This updates 'nixos-rebuild edit' to handle that case correctly.