Not able to disable initrd in my sdimage

I am creating a NixOS sdimage. It works fine on my hardware. But when I disable initrd I get following error:

warning: Git tree '/home/gangaram/workspace/deploy/ghaf' is dirty
warning: input 'nixos-hardware' has an override for a non-existent input 'nixpkgs'
error: attribute 'initialRamdisk' missing

       at /nix/store/pp35kzqx97fkkl7az1fb9ygphr6qi9h0-source/nixos/modules/system/activation/top-level.nix:10:23:

            9|         "${config.system.boot.loader.kernelFile}";
           10|       initrdPath = "${config.system.build.initialRamdisk}/" +
             |                       ^
           11|         "${config.system.boot.loader.initrdFile}";
(use '--show-trace' to show detailed location information)

To disable initrd I use:

boot.initrd.enable = false;

The image contains a rootfs and I have configured kernel param to use the rootfs. It runs fine when initrd is enabled(default) and the kernel mounts the rootfs.
But now I want to disable initrd as I don’t need it but I am getting the error. Can anybody guide me, if I am missing any thing?

That is not supported by the script that builds the sd card image.