Issues when building an initrd derivation with a prepend option

I’m trying to use boot.initrd.prepend = [(toString ./acpi_override)] but encounter an error when building initrd itself.

As you can see, this file exists in my flake and option evaluates to a store path:

[azahi@ilmare:~/src/nixfiles]$ file configurations/ilmare/acpi_override 
configurations/ilmare/acpi_override: ASCII cpio archive (SVR4 with no CRC)

[azahi@ilmare:~/src/nixfiles]$ nix eval .#nixosConfigurations.ilmare.config.boot.initrd.prepend
[ "/nix/store/rmssa049ivylddy5wbf7hz0rayzxr602-microcode-intel-20240531/intel-ucode.img" "/nix/store/6svpxb9rm61j4jcflm82qwrbgdgvvv7y-source/configurations/ilmare/acpi_override" ]

But that path is inaccessible when building an initrd derivation:

[azahi@ilmare:~/src/nixfiles]$ nix build .#nixosConfigurations.ilmare.config.system.build.initialRamdisk
this derivation will be built:
  /nix/store/44macynjnfgvszsisiyx6cqfnh9aam9d-initrd-linux-6.9.6.drv
building '/nix/store/44macynjnfgvszsisiyx6cqfnh9aam9d-initrd-linux-6.9.6.drv'...
initrd-linux> /bin -> /nix/store/h1s92jyac0fvffc0dhz3zidq9xk1ncpb-initrd-bin-env/bin
initrd-linux> /etc/crypttab -> /nix/store/iw3w7hk19qlrhrv2b21ak7v2pnpzn0cc-initrd-crypttab
initrd-linux> /etc/dbus-1 -> /nix/store/0lqwvqpdhbc42v3wiyf1rn3kn7jh9p0y-dbus-1
initrd-linux> /etc/group -> /nix/store/a93xm0j3pm3ba92pmgypghxi22kbynxf-initrd-group
initrd-linux> /etc/hostid -> /nix/store/2va4j2jb8415zwiqz19dl70s5a54fwzk-gen-hostid
initrd-linux> /etc/initrd-release -> /nix/store/fhzap397bf066r0mnakq1nwjmn1chm5h-initrd-release
initrd-linux> /etc/kbd -> /nix/store/fnad3hz3k4zsnhq3n5dai7n17292092i-console-env/share
initrd-linux> /etc/modprobe.d/debian.conf -> /nix/store/nyifiwqqhwjf50nrfjcxm7daqps53g4v-kmod-debian-aliases.conf-30+20230601-2
initrd-linux> /etc/modprobe.d/nixos.conf -> /nix/store/12rkyzx5a6didvgvpf07g6hnsdzxvbbh-etc-modprobe.d-nixos.conf
initrd-linux> /etc/modprobe.d/systemd.conf -> /nix/store/cym39cl4v79bmbng4bvafkxagz96f4hw-systemd-255.6/lib/modprobe.d/systemd.conf
initrd-linux> /etc/modprobe.d/ubuntu.conf -> /nix/store/dc25nggqgnnfss15cdaicjrfbaqcp1l2-initrd-kmod-blacklist-ubuntu
initrd-linux> /etc/modules-load.d/nixos.conf -> /nix/store/nisqhqz7kjr0vgffis2wrg6yxm4qh1hj-initrd-nixos.conf
initrd-linux> /etc/os-release -> /nix/store/fhzap397bf066r0mnakq1nwjmn1chm5h-initrd-release
initrd-linux> /etc/passwd -> /nix/store/jh25g3zxx8kxh14avj199i88h6r2f2nf-initrd-passwd
initrd-linux> /etc/shadow -> /nix/store/bcrjybd5fhwsv7m465pj8hvnhgnfa73f-initrd-shadow
initrd-linux> /etc/shells -> /nix/store/lww6hg1z31aghkyw39j08sapzgm3sw5r-initrd-shells
initrd-linux> /etc/sysctl.d/nixos.conf -> /nix/store/2k6n08awzpmdshxj8l5phbrvib7vjdwl-initrd-nixos.conf
initrd-linux> /etc/systemd/network/80-iwd.link -> /nix/store/jzsh5831iznamamq2lmw17fvpm350dhr-unit-80-iwd.link/80-iwd.link
initrd-linux> /etc/systemd/networkd.conf -> /nix/store/7myyj0k72qpqcpxm8khsgms5nqrn0yq8-initrd-networkd.conf
initrd-linux> /etc/systemd/resolved.conf -> /nix/store/1r3bqzgkqcqkvy7hpa6a2m064yyksdn1-initrd-resolved.conf
initrd-linux> /etc/systemd/system -> /nix/store/izv40p3357i4z4rhl29i1q5fp38j3pql-initrd-units
initrd-linux> /etc/systemd/system.conf -> /nix/store/q04y1cfc2p00x7pcf7n5mximcjs7vx3w-initrd-system.conf
initrd-linux> /etc/tmpfiles.d/resolv.conf -> /nix/store/bqp27j0hvkvxyf5lqaxkvg62g8vgx5r5-initrd-resolv.conf
initrd-linux> /etc/udev/rules.d -> /nix/store/cx1lk418x5z35fnhb710shf9fwk4xhfx-initrd-udev-rules
initrd-linux> /etc/vconsole.conf -> /nix/store/42iszb1rd3nsbdmc1qdz8gsx8ikg313y-vconsole.conf
initrd-linux> /init -> /nix/store/cym39cl4v79bmbng4bvafkxagz96f4hw-systemd-255.6/lib/systemd/systemd
initrd-linux> /lib -> /nix/store/jd1v8ixwfzg26zqa4g0svj9phb9zmnw8-linux-6.9.6-modules-shrunk/lib
initrd-linux> /sbin -> /nix/store/h1s92jyac0fvffc0dhz3zidq9xk1ncpb-initrd-bin-env/sbin
initrd-linux> /tmp/.keep -> /nix/store/gvqqqv7yznc84mswklkq3bi6rlrkw8gs-initrd-.keep
initrd-linux> Warning: Couldn't satisfy dependency libc.so.6 for "/nix/store/dbwp0scbb0rk78m636sb7cvycz8xzgyh-glibc-2.39-52/lib/libnss_files.so.2"
initrd-linux> Warning: Couldn't satisfy dependency libsystemd-shared-255.so for "/nix/store/cym39cl4v79bmbng4bvafkxagz96f4hw-systemd-255.6/lib/systemd/libsystemd-core-255.so"
initrd-linux> Warning: Couldn't satisfy dependency ld-linux-x86-64.so.2 for "/nix/store/dbwp0scbb0rk78m636sb7cvycz8xzgyh-glibc-2.39-52/lib/libc.so.6"
initrd-linux> Warning: Couldn't satisfy dependency libc.so.6 for "/nix/store/dbwp0scbb0rk78m636sb7cvycz8xzgyh-glibc-2.39-52/lib/libm.so.6"
initrd-linux> Warning: Couldn't satisfy dependency ld-linux-x86-64.so.2 for "/nix/store/dbwp0scbb0rk78m636sb7cvycz8xzgyh-glibc-2.39-52/lib/libm.so.6"
initrd-linux> Warning: Couldn't satisfy dependency libc.so.6 for "/nix/store/dbwp0scbb0rk78m636sb7cvycz8xzgyh-glibc-2.39-52/lib/libdl.so.2"
initrd-linux> Warning: Couldn't satisfy dependency libc.so.6 for "/nix/store/dbwp0scbb0rk78m636sb7cvycz8xzgyh-glibc-2.39-52/lib/libpthread.so.0"
initrd-linux> Warning: Couldn't satisfy dependency libc.so.6 for "/nix/store/dbwp0scbb0rk78m636sb7cvycz8xzgyh-glibc-2.39-52/lib/librt.so.1"
initrd-linux> Warning: Couldn't satisfy dependency libc.so.6 for "/nix/store/pd8xxiyn2xi21fgg9qm7r0qghsk8715k-gcc-13.3.0-libgcc/lib/libgcc_s.so.1"
initrd-linux> Warning: Couldn't satisfy dependency libc.so.6 for "/nix/store/ilbsi0qyk6kr0l9zr8yqzwdmhw6vh2k1-libidn2-2.3.7/lib/libidn2.so.0.4.0"
initrd-linux> Warning: Couldn't satisfy dependency libc.so.6 for "/nix/store/dbwp0scbb0rk78m636sb7cvycz8xzgyh-glibc-2.39-52/lib/libresolv.so.2"
initrd-linux> Warning: Couldn't satisfy dependency libc.so.6 for "/nix/store/ymi1acd7jmq0xbk44cklb78gjxsswg0c-libunistring-1.1/lib/libunistring.so.5.0.0"
initrd-linux> cat: /nix/store/6svpxb9rm61j4jcflm82qwrbgdgvvv7y-source/configurations/ilmare/acpi_override: No such file or directory
error: builder for '/nix/store/44macynjnfgvszsisiyx6cqfnh9aam9d-initrd-linux-6.9.6.drv' failed with exit code 1;
       last 25 log lines:
       > /etc/systemd/network/80-iwd.link -> /nix/store/jzsh5831iznamamq2lmw17fvpm350dhr-unit-80-iwd.link/80-iwd.link
       > /etc/systemd/networkd.conf -> /nix/store/7myyj0k72qpqcpxm8khsgms5nqrn0yq8-initrd-networkd.conf
       > /etc/systemd/resolved.conf -> /nix/store/1r3bqzgkqcqkvy7hpa6a2m064yyksdn1-initrd-resolved.conf
       > /etc/systemd/system -> /nix/store/izv40p3357i4z4rhl29i1q5fp38j3pql-initrd-units
       > /etc/systemd/system.conf -> /nix/store/q04y1cfc2p00x7pcf7n5mximcjs7vx3w-initrd-system.conf
       > /etc/tmpfiles.d/resolv.conf -> /nix/store/bqp27j0hvkvxyf5lqaxkvg62g8vgx5r5-initrd-resolv.conf
       > /etc/udev/rules.d -> /nix/store/cx1lk418x5z35fnhb710shf9fwk4xhfx-initrd-udev-rules
       > /etc/vconsole.conf -> /nix/store/42iszb1rd3nsbdmc1qdz8gsx8ikg313y-vconsole.conf
       > /init -> /nix/store/cym39cl4v79bmbng4bvafkxagz96f4hw-systemd-255.6/lib/systemd/systemd
       > /lib -> /nix/store/jd1v8ixwfzg26zqa4g0svj9phb9zmnw8-linux-6.9.6-modules-shrunk/lib
       > /sbin -> /nix/store/h1s92jyac0fvffc0dhz3zidq9xk1ncpb-initrd-bin-env/sbin
       > /tmp/.keep -> /nix/store/gvqqqv7yznc84mswklkq3bi6rlrkw8gs-initrd-.keep
       > Warning: Couldn't satisfy dependency libc.so.6 for "/nix/store/dbwp0scbb0rk78m636sb7cvycz8xzgyh-glibc-2.39-52/lib/libnss_files.so.2"
       > Warning: Couldn't satisfy dependency libsystemd-shared-255.so for "/nix/store/cym39cl4v79bmbng4bvafkxagz96f4hw-systemd-255.6/lib/systemd/libsystemd-core-255.so"
       > Warning: Couldn't satisfy dependency ld-linux-x86-64.so.2 for "/nix/store/dbwp0scbb0rk78m636sb7cvycz8xzgyh-glibc-2.39-52/lib/libc.so.6"
       > Warning: Couldn't satisfy dependency libc.so.6 for "/nix/store/dbwp0scbb0rk78m636sb7cvycz8xzgyh-glibc-2.39-52/lib/libm.so.6"
       > Warning: Couldn't satisfy dependency ld-linux-x86-64.so.2 for "/nix/store/dbwp0scbb0rk78m636sb7cvycz8xzgyh-glibc-2.39-52/lib/libm.so.6"
       > Warning: Couldn't satisfy dependency libc.so.6 for "/nix/store/dbwp0scbb0rk78m636sb7cvycz8xzgyh-glibc-2.39-52/lib/libdl.so.2"
       > Warning: Couldn't satisfy dependency libc.so.6 for "/nix/store/dbwp0scbb0rk78m636sb7cvycz8xzgyh-glibc-2.39-52/lib/libpthread.so.0"
       > Warning: Couldn't satisfy dependency libc.so.6 for "/nix/store/dbwp0scbb0rk78m636sb7cvycz8xzgyh-glibc-2.39-52/lib/librt.so.1"
       > Warning: Couldn't satisfy dependency libc.so.6 for "/nix/store/pd8xxiyn2xi21fgg9qm7r0qghsk8715k-gcc-13.3.0-libgcc/lib/libgcc_s.so.1"
       > Warning: Couldn't satisfy dependency libc.so.6 for "/nix/store/ilbsi0qyk6kr0l9zr8yqzwdmhw6vh2k1-libidn2-2.3.7/lib/libidn2.so.0.4.0"
       > Warning: Couldn't satisfy dependency libc.so.6 for "/nix/store/dbwp0scbb0rk78m636sb7cvycz8xzgyh-glibc-2.39-52/lib/libresolv.so.2"
       > Warning: Couldn't satisfy dependency libc.so.6 for "/nix/store/ymi1acd7jmq0xbk44cklb78gjxsswg0c-libunistring-1.1/lib/libunistring.so.5.0.0"
       > cat: /nix/store/6svpxb9rm61j4jcflm82qwrbgdgvvv7y-source/configurations/ilmare/acpi_override: No such file or directory
       For full logs, run 'nix log /nix/store/44macynjnfgvszsisiyx6cqfnh9aam9d-initrd-linux-6.9.6.drv'.

The file is git added and is definitely being copied to the store along with the flake source:

[azahi@ilmare:~/src/nixfiles]$ file /nix/store/6svpxb9rm61j4jcflm82qwrbgdgvvv7y-source/configurations/ilmare/acpi_override
/nix/store/6svpxb9rm61j4jcflm82qwrbgdgvvv7y-source/configurations/ilmare/acpi_override: ASCII cpio archive (SVR4 with no CRC)

Why is this happening?

Okay, this looks like an issue with ${./foobar} and toString ./foobar differences. Problem solved.