Starting a compositor with uwsm declaratively?

I followed the Hyprland page on uwsm for installation and declared the following in ~/.profile to start it with uwsm on startup. How could I declare it my nix configuration?

    if uwsm check may-start; then
        exec uwsm start hyprland.desktop
    fi

https://search.nixos.org/options?channel=25.05&show=programs.hyprland.withUWSM&from=0&size=50&sort=relevance&type=packages&query=hyprland+uwsm

environment.loginShellInit = ''
  if uwsm check may-start; then
    exec uwsm start hyprland.desktop
  fi
'';