X-systemd.automount makes activation fail

Hi all,
I’ve just found out about the x-systemd.automount option in fstab from Samba - NixOS Wiki so i thought I’d give it a try also for a local HDD I have installed on my system.

My config looks like this:

 fileSystems."/mnt/HDD".options = [
   "defaults"
   "noauto"
   "x-systemd.automount"
   "x-systemd.idle-timeout=5m"
   "x-systemd.device-timeout=1s"
   "x-systemd.mount-timeout=1s"
];

But when I try to run nixos-rebuild switch I get the following error at the activation phase:

Error: Failed to open unit file /nix/store/h5qfbppr0s2yfdgxgr1fiswjcrx81hpf-nixos-system-computerone-24.11.20241014.a3c0b3b/etc/systemd/system/mnt-HDD.mount

Caused by:
    No such file or directory (os error 2)
warning: error(s) occurred while switching to the new configuration

which makes the whole process fail.

Does anyone know how should I fix this?
Thanks!

Update: rebooting has somehow fixed the issue (?)

During the reboot I’ve read on the tty something on systemd automount for HDD being successful so when I dropped into the desktop I tried to ls /mnt/HDD which got mounted correctly on the fly.

My flake also now builds and activates with no issues, no changes made.

I’m glad that the problem is fixed but I’m very confused on what happened.
There seems to be the same issue every time I edit the x-systemd.* options for any entry in fstab and they magically go away on reboot.

If someone has an explanation please let me know, thank you