From the doc:
containers.<name>.path
As an alternative to specifying config, you can specify
the path to the evaluated NixOS system configuration,
typically a symlink to a system profile.
Type: path
Example: "/nix/var/nix/profiles/per-container/webserver"
I have a container like that, and built the path with nix build someFlake#nixosConfigurations.<name>.config.system.build.toplevel --profile /nix/var/nix/profiles/per-container/webserver
but the container could not start, complaining: /nix/store/<hash>-container-init: line 36: /nix/var/nix/profiles/per-container/webserver/init: No such file or directory
even when I can confirm that path exists.