Configure second monitor with changing names

As a teacher I often connect to different second monitors, that often have different names.

On NixOS I have a rule in my hyprland.nix that sets workspaces 1-4 to the first monitor. And I have a rule that sets workspaces 5-8 to the second monitor. It looks like this:

      monitor = [
	      "eDP-1,preferred,auto-center-down,1.5"
	      ",preferred,auto-center-up,1"
	    ];

	    workspace = [
	      "1,monitor:eDP-1,default:true"  
	      "2,monitor:eDP-1,default:true"  
	      "3,monitor:eDP-1,default:true"  
	      "4,monitor:eDP-1,default:true"

	      "5,monitor:HDMI-A-1,default:true"  
	      "6,monitor:HDMI-A-1,default:true"  
	      "7,monitor:HDMI-A-1,default:true"  
	      "8,monitor:HDMI-A-1,default:true"  

	    ];

The problem is that the second monitor is not always called HDMI-A-1.

Is there a way to configure hyprland so that when I attach a second monitor, regardless of its name, workspaces 5-8 are always show there?

Its weird that the monitor changes the name of the output?
That output should be named via the motherboard / video card i thought?

Or are you plugging into different ports with different monitors?