A pure way to add nixos repo to custom iso?

Currently I’m adding my system flake to the repo using --impure and isoImage.contents

isoImage.contents = [{
    source = /home/username/nixcfg;
    target = "/nixcfg/"; # /iso/nixcfg

Is there a pure way of adding the system flake repository to the iso?

You can add your system flake as an input to the iso flake and reference the system flake path here. Or what I do is just configure the iso within my system flake, so I can access my system flake as self