Building custom iso is easy:
- Install NixOS
- Configure it how you like by writing configuration.nix
- Reuse your configuration when building an iso: Creating a NixOS live CD - NixOS Wiki
How can I install flatpaks inside the iso?
Building custom iso is easy:
How can I install flatpaks inside the iso?