services.displayManager.ly.settings option doesnt work

helloooooooo everybody. im new to linux, new to nixos!! its terrific., really…
anyway, so im learning new things everyday. tinkering with stuff here and there…

and so ive stumbled upon an issue where ly, the TUI login thingie, seem to not have a working services.displayManager.ly.settings option, to be exact - it DOES merge text with the /etc/ly/config.ini, but while doing so it completely ruins all sessions (they disappear), and on top of that the settings that it appended dont work either. i was expecting my little (built-in) animations and clock to work…

  services.displayManager.ly = {
    enable = true;
    settings = {
      animate = true;
      animation = "cmatrix";
      hide_borders = true;
      clock = "%c";
      bigclock = true;
      hide_f1_commands = true;
      # ...
    };
  };

EDIT: OLD AF! see new .settings below!

i am on Warbler - the unstable branch, no home manager, but using flakes (unrelated i think). yes, this thing does compile no bother, at least since the last time i commented it out. um…

i dont really know what else to add. it just completely ruins the system. my guess is, and im not an expert at all, that ly could be broken at the moment - it was included just about a couple months ago, is it not?

for the time being, i have commented .settings out… sadge.

thank you very much for any information on this in advance!

i would also like to add (sorry, no edit button!) that if you do try this and end up with just a shell and xinitrc sessions, do not login into shell from there. when that happens, tty2 which it is occupying by default, is not functional (e.g. unable to elevate privileges because the password prompt is not reacting to anything!). so use tty1 instead!

as the problem is currently being investigated / fixed i have since also tried tuigreet, which is a part of greetd, written in rust <3

here is my minimal config (thanks to sjcobb2022 for the kernel log anti-spam solution):

  services.xserver.displayManager.startx.enable = true; # for X11 sessions
  services.greetd = {
    enable = true; # "programs.uwsm.enable"?
    package = pkgs.greetd.tuigreet;
    restart = true;
    settings = {
      default_session = {
        command = "${pkgs.greetd.tuigreet}/bin/tuigreet -t -r --remember-session";
        user = "greeter"; # NOT a username
      };
    };
  };
  # optional below
  systemd.services.greetd.serviceConfig = {
    Type = "idle";
    StandardInput = "tty";
    StandardOutput = "null"; # no tty spam
    StandardError = "journal"; 
    TTYReset = true; 
    TTYVHangup = true; 
    TTYVTDisallocate = true; 
  };

it also helped me with the broken hyprland’s UWSM (proper systemd) which i couldnt use with ly (cos it “works poorly”), so at the moment - this is the thing that does the thing right!

P.S. it seems taht there are no animations (duh, i mean the fire or cmatrix!) …but you can change colours!

P.P.S. i found another tui login manager!!! called lemurs. im going to try it just for practice :stuck_out_tongue_winking_eye:
EDIT: apparently there is no services.lemurs.enable :sob:

I was experiencing the same problem. ly would ignore the config file and just not start correctly only showing shell and xinitrc. And I had no idea how to debug it :frowning:. Furthermore, it seemed to ignore the default settings as defined in nixpkgs and would instead try to use the defaults from the source (for example the shutdown command would complain that some path was missing - the path in question was defined in the source code, it was not the path from the nixpgk)

However! It seems the ly was updated to 1.1.0 in nixos-unstable a few days ago and it works for me now after I upgraded! ly: 1.0.3 -> 1.1.0 · NixOS/nixpkgs@166babb · GitHub

1 Like

okay, i tried it just now… it doesnt work.

even worse, it is now completely non-functional. when i install ly, as soon as it launches my screen goes black with a blinking underscore, which, i assume, is tty7 - the xorg server.

i cant even provide any logs!

what is even more interesting, is that the system update (in my case it is nh os switch) doesnt finish, because when i reboot, everything goes back to normal, but no changes were applied!

nevermind, i had to nh os boot so that i could apply changes after the boot. now it works! BUT

Hyprland (UWSM) session is still a problem. it just refuses to login. no idea how to check the logs. so… yeah, no, i shall stick with lemurs and tuigreet

EDIT: okay. one way to launch hyprland is by going to another tty and typing this:

uwsm start hyprland-uwsm.desktop

non-UWSM session would be just

Hyprland

suboptimal, but whatever

i assume what is happening here is that ly doesnt exit its session, and hyprland doesnt know what tty it is in, so they conflict. perhaps login_cmd in services.displayManager.ly.settings will help to execute a command to kill ly or something, or as a last resort, launch hyprland in another tty??

Mind if I ask how you got lemurs working? Although ly is functional and I CAN login into Niri, there’re still some quirks I’d need to fix (something’s wrong with the big clock thingy, my colors don’t seem right…). Can’t seem to figure out alternatives either.

ah! sorry, i was actually hoping you would say something like “lemurs? but there is no option! here is how i did it in my config:”, and then i would have yoinked it. but if i HAD to guess with my limited knowledge of nixOS, it would be a shell script that just simply launches the binary, after all, its just a CLI command, right?

first, obvs, install pkgs.lemurs lol, and then lets try launching it on logind, i assume?:

  environment.extraInit = ''
    ${pkgs.lemurs}/bin/lemurs # or just 'lemurs'?
  '';

or

  environment.etc."xdg/autostart/lemurs.desktop".text = ''
    [Desktop Entry]
    Type=Application
    Name=lemurs
    Exec=sh -c "lemurs"
    NoDisplay=true # or 'false'? idk
  '';

or even

  systemd.services.lemurs = {
    enable = true;
    serviceConfig = {
      ExecStart = "lemurs"; # or "${pkgs.lemurs}/bin/lemurs"?
      # Type = "exec"; # or "simple"? 
    };
    # script = "lemurs"; # instead of ExecStart?
  };

UPDATE: i just tested these. NOPE, it tries to launch but lemurs fails with:

Failed to open log file: '/var/log/lemurs.log'

so, someone has to make a lemurs service option…

i dont know!!! these are my guesses, I HAVE NOT TESTED THESE, sorry, and i also dont have the time right now… please someone correct me or tell me i did it right :smirk_cat:

oh, and i completely forgot: here is my tuigreet setup that, if i got that right, you were not able to configure:

silly colours example whatever with everything enabled (for small screen sizes! PDAs, steam deck & MNT pocket) (you will probably need console.font = "latarcyrheb-sun32" for a larger TTY font and better readability. idk how to pronounce that

  services.greetd = {
    enable = true; # "programs.uwsm.enable"?
    package = pkgs.greetd.tuigreet; 
    restart = true; # optional
    # vt = 1; # tty
    settings = {
      default_session = {
        command = "${pkgs.greetd.tuigreet}/bin/tuigreet -w 69 -t --time-format '%B, %A %d @ %H:%M:%S' -r --remember-session --asterisks --user-menu -g 'Password: ********' --container-padding 1 --prompt-padding 0 --theme 'border=magenta;text=white;prompt=cyan;time=green;action=yellow;button=red;container=black;input=white'";
        user = "greeter"; # NOT a username
        # ...
      };
    };
  };

to remove systemd spam in TTY login managers, use the thing above which edits the service’s StandardOutput

my ly config is WIP, im figuring out whether the colours are hex ARGB ro hex RGBA…

edit: okay got it. it’s 24-bit 0xSSRRGGBB, where SS is styling, as defined here:

#define TB_BOLD      0x01000000
#define TB_UNDERLINE 0x02000000
#define TB_REVERSE   0x04000000
#define TB_ITALIC    0x08000000
#define TB_BLINK     0x10000000
#define TB_HI_BLACK  0x20000000
#define TB_BRIGHT    0x40000000
#define TB_DIM       0x80000000

okay, got a config going. this one’s psychedelic :stuck_out_tongue:

  services.displayManager.ly = {
    enable = true;
    package = pkgs.ly; # TUI -- zig -- https://codeberg.org/AnErrupTion/ly
    x11Support = true;
    settings = {
      # allow_empty_password = false; # dangerous?
      animation = "colormix"; # "doom", "matrix", "colormix"
      animation_timeout_sec = 300; # 5 minutes
      auth_fails = 3; # special animation looks broken?
      bg = "0x02000000";
      # bigclock = "en"; # enlarges the clock -- may not work with some fonts?
      # blank_box = false; # transparent
      border_fg = "0x01FFFFFF";
      box_title = "null"; # text above the box
      clear_password = true;
      clock = "%B, %A %d @ %H:%M:%S";
      colormix_col1 = "0x08FF0000";
      colormix_col2 = "0x0800FF00";
      colormix_col3 = "0x080000FF";
      default_input = "password";
      error_bg = "0x02000000";
      error_fg = "0x01FF0000";
      fg = "0x01FFFFFF";
      hide_borders = true;
      hide_version_string = true; # doesnt work?
      hide_key_hints = true;
      initial_info_text = "null"; # hostname
      # input_len = 69;
      lang = "en";
      load = true;
      margin_box_h = 0;
      margin_box_v = 0;
      min_refresh_delta = 100; # milliseconds -- default=5
      # numlock = true;
      save = true;
      text_in_center = false; # ugly
      # tty = 4; # broken? -- could help with UWSM sessions
      # vi_default_mode = "insert";
      # vi_mode = true;
      # ...
    };
  };

i wouldve provided a screenshot but idk how to screenshot a tty, yknow…

anyway, i have lots of things to share, but the nixOS community is not ready for my 10k lines config yet… :crazy_face:

update: you dont have to use pkgs.greetd.greetd to download the whole thing, you can just use pkgs.greetd.tuigreet

you can post your nixos config in a github/gitlab/any public git repo after removing any secrets/private information if you are interested.