There are 2 possibilities to do it:
Rebuilding like this: NIXOS_LABEL="somelabel" nixos-rebuild switch
Configuring system.nixos.label and optionally system.nixos.tags in configuration.nix (See the links for full info)
When you use the 2 possibilities at the same time, the first one will get priority.
Important: Labels don't support all types of chars. Spaces won't work.