Trouble configuring custom ISO

I’m trying to follow the docs and create a custom ISO with ssh enabled and my public key added. It seems to complete successfully but neither the Live CD installation nor the installed version of NixOS have any of my configurations.

I’m using NixOS release 21.11 and build id 166445692 in a Proxmox lxc to build the ISO.

My iso.nix:

# This module defines a small NixOS installation CD.  It does not
# contain any graphical stuff.
{config, pkgs, ...}:
{
  imports = [
    <nixpkgs/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix>

    # Provide an initial copy of the NixOS channel so that the user
    # doesn't need to run "nix-channel --update" first.
    <nixpkgs/nixos/modules/installer/cd-dvd/channel.nix>
  ];

  # Enable SSH in the boot process.
  systemd.services.sshd.wantedBy = pkgs.lib.mkForce [ "multi-user.target" ];
  users.users.root.openssh.authorizedKeys.keys = [
    "<my key>"
  ];
}

My build command:

nix-build '<nixpkgs/nixos>' -A config.system.build.isoImage -I nixos-config=iso.nix   

Then I download the ISO, upload to Proxmox, create a VM using that ISO. On the VM both the Live CD and the final installed version have no authorized keys. I’m checking using:

nixos-option users.users.root.openssh.authorizedKeys.keys

The result is an empty array.

Where did my iso.nix customizations go?

Haven’t used that method so not sure why it’s not working, but I’ve had good results with https://github.com/nix-community/nixos-generators.