I think you can use import to load the expression from each file, and the // operator to combine imported attribute sets. Like this:
Edit: This doesn't work - see replies
# flake.nix
{
inputs =
import ./inputs/nixpkgs.nix //
import ./inputs/nix-index.nix;
# ...
}
# inputs/nixpkgs.nix
{
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
}
# inputs/nix-index.nix
{
nix-index-database = {
url = "github:Mic92/nix-index-database";
inputs.nixpkgs.follows = "nixpkgs";
};
}