How to enable login screen and start hyperland after login

I installed NixOS without a desktop environment. Then I installed Hyprland by setting programs.hyprland.enable = true;

Now, after the system boots, I have to login in into TTY and then manually start hyprland with command Hyprland.

What configuration am I missing so that a login screen is displayed after boot and after I provide the username&password, I am dropped directly into hyprland desktop?

I’m not sure a display manager is needed but here’s my config that auto starts it:

   services.xserver.enable = true;
   services.xserver.displayManager.sddm.enable = true;
   services.xserver.displayManager.sddm.wayland.enable = true;
   services.xserver.displayManager.sddm.theme = "where_is_my_sddm_theme";

I added where-is-my-sddm-theme to my systemPackages. I followed hyprland quick start advice.

1 Like

Thank you, it works.

I wonder, however, is it really necessary to run the xserver for this is there a wayland login manager?

I found the answer here using greetd/tuigreet:

1 Like

sddm has experimental wayland support, as @rjpc configures.

Gdm also supports wayland, and greetd is an option too indeed.

Yes, I wondered that myself and played around with disabling and enabling xserver and it seemed having it enabled was required (a bit counter intuitive, for sure); nice find with greetd!

Hum, I used greetd.gtkgreet on hyprland before I switched to sway and it worked fine. I don’t think an Xorg login manager is required?


I think the easiest way would be to create some sort of startup shell script or a systemd service that starts on login.

This forum post might be helpful as well.

Yeah, I think xserver might just be needed for sddm? :confused:

I think OP just wants hyprland to autostart on login through the tty. They don’t need a full fat display manager, if I am interpreting correctly.

1 Like

I thought so at first but re-reading it OP asks

[what] am I missing so that a login screen is displayed after boot and after I provide the username&password I am dropped directly into hyprland desktop

They found which doesn’t require xserver nonsense.

1 Like

I see; my bad. If this issue is solved, can @djelenc mark the solution?