nixos-rebuild switch will read its configuration from /etc/nixos/flake.nix if it is present.
nixos-rebuild switch
/etc/nixos/flake.nix