Install NixOS with an existing configuration

Is it possible to create an iso that contains a copy of my nixos config which will be used to build the newly created system? I basically want the default graphical gnome iso/installer with it’s partitioning capabilities which will just use my own config instead of the default that will be placed at /etc/nixos/configuration.nix. There should be an easy way to copy files from the iso to new system. Even if they’re aren’t directly used to build the system (that could be then easily done with a script).

I know this has been asked a few times already but I haven’t really found a precise and concise answer. Just people mentioning nixos-generators, nixos-install and a few other things. For now I have just been using the default iso and calling a script on the fresh install I wrote that I download from a public repo. Now my repo is private though and I can’t come up with an easy way to copy the config from the internet. Writing another script that is public and takes care of the authentication and everything which then calls the private script isn’t something I want to do. I am fine with the iso having access to everything.

Have a look at the NixOS manual: NixOS Manual
Except that instead of adding a driver you would be adding extra files in the ISO system.

Maybe something like:

{
  imports = [ ./installation-cd-graphical-gnome.nix ];

  environment.etc.nixos.source = /etc/nixos;
  installer.cloneConfig = false; # declared in nixos/modules/profile/clone-config.nix
}