NixOS + ZFS: zpool import script fails, "/dev/disk/by-id" is empty

The systemd script generated by ‘nixos/modules/tasks/filesystems/zfs.nix’ fails to import the ZFS pool because there are no devices in “/dev/disk/by-id”.

I solved it by setting boot.zfs.devNodes = “/dev”.

But why is “/dev/disk/by-id” empty?

Could you please share your config?

{ config, lib, pkgs, ... }:
{
  system.stateVersion = "25.11"; # Did you read the comment?
  imports = [ ./hardware-configuration.nix ];
  nix.settings.experimental-features = [ "nix-command" "flakes" ];
  boot.supportedFilesystems = [ "zfs" ];
  boot.zfs.forceImportRoot = false; # default after 26.11
  boot.loader.grub = {
    enable = true;
    zfsSupport = true;
    efiSupport = true;
    efiInstallAsRemovable = true;
    mirroredBoots = [
      { devices = [ "nodev"]; path = "/boot"; }
    ];
  };
  networking.hostId = "secret";

  services.zfs.autoScrub.enable = false;
  services.zfs.autoSnapshot.enable = false;
  boot.zfs.devNodes = "/dev/"; 
  fileSystems."/mnt/tank" = {
    device = "tank/dataset";
    fsType = "zfs";
  };
}