Open frogamic opened 3 years ago
I have the same issue on NixOS 20.09 but with lightdm-tiny-greeter
/var/log/lightdm/lightdm.log
...
[+0.61s] DEBUG: Greeter connected version=1.30.0 api=1 resettable=false
[+0.61s] DEBUG: Greeter start authentication
[+0.61s] DEBUG: Session pid=1003: Started with service 'lightdm', username '(null)'
[+0.62s] DEBUG: Session pid=1003: Got 1 message(s) from PAM
[+0.62s] DEBUG: Prompt greeter with 1 message(s)
[+2.92s] DEBUG: Continue authentication
[+2.92s] DEBUG: Session pid=1003: Got 1 message(s) from PAM
[+2.92s] DEBUG: Prompt greeter with 1 message(s)
[+4.13s] DEBUG: Continue authentication
[+4.14s] DEBUG: Session pid=1003: Authentication complete with return value 0: Success
[+4.14s] DEBUG: Authenticate result for user mladen: Success
[+4.14s] DEBUG: User mladen authorized
[+4.14s] DEBUG: Greeter requests session default
[+4.14s] DEBUG: Seat seat0: Failed to find session configuration default
[+4.14s] DEBUG: Seat seat0: Can't find session 'default'
with this config:
services.xserver = {
displayManager = {
defaultSession = "none+bspwm";
lightdm.greeters.tiny.enable = true;
};
windowManager.bspwm = {
enable = true;
configFile = "${./bspwmrc}";
sxhkd.configFile = "${./sxhkdrc}";
};
};
However, other greeters - such as mini - actually do work properly and request the session none+bspwm
. Relevant config is basically identical (except the greeter ofc):
services.xserver = {
displayManager = {
defaultSession = "none+bspwm";
lightdm.greeters.mini = {
enable = true;
user = "mladen";
};
};
windowManager.bspwm = {
enable = true;
configFile = "${./bspwmrc}";
sxhkd.configFile = "${./sxhkdrc}";
};
};
Metadata:
"x86_64-linux"
Linux 5.9.16, NixOS, 20.09.2497.4a75ca4a4e7 (Nightingale)
yes
yes
nix-env (Nix) 2.3.9
/nix/var/nix/profiles/per-user/root/channels/nixos
What does a default session of none+bspwm
mean?
mini-greeter(and I assume tiny-greeter) just uses lightdm's default-session functionality, which requires a matching XYZ.desktop
file in /usr/share/xsessions/
NixOS uses the notion of DE+WM
from what I can tell (I started using it on graphical systems ~2 weeks ago), so you could have xfce+bspwm
for example. In my case I was starting X for the first time so I had no ~/.dmrc
referencing any session types. My /usr/share/xsessions/
folder did only contain one file none+bspwm.desktop
.
It seems that this bug then is specific to first X startup, where the default session type as specified in services.xserver.displayManager.defaultSession
is not correctly picked up by LightDM. I am not familiar with LightDM, but is there a way to specify the systemwide default if ~/.dmrc
is not found?
I just tested my theory, and after switching from lightdm-gtk-greeter back to lightdm-mini-greeter it works fine. However I do not have a ~/.dmrc
file, so that cannot be what is causing it to know which session to start as default. I would be curious where this default session is being persisted by NixOS.
The canonical lightdm.conf
indicates that this could be solved by adding user-session = ${services.xserver.displayManager.defaultSession}
to the [Seat:*]
section of the /etc/lightdm/lightdm.conf
generated by NixOS. I am cautious that setting this in lightdm.conf
could override another setting somewhere as I do not know how lightdm's config hierarchy works.
I have tested this on a VM and was able to reproduce the issue every time lightdm-mini-greeter
was used as the first greeter for first x startup. Using services.xserver.displayManager.lightdm.extraSeatDefaults
to set the default user-session
did fix this, however that seems redundant and a fix in lightdm.nix
would be preferable.
this could be solved by adding
user-session = ${services.xserver.displayManager.defaultSession}
Yes, setting this option is what mini-greeter expects you to do. This is what lightdm.nix
used to do when mini-greeter
was added:
https://github.com/NixOS/nixpkgs/blob/6b9a99e55d537c27c5b384d58c997839a0519df9/nixos/modules/services/x11/display-managers/lightdm.nix
I believe anything in cfg.extraSeatDefaults
will be able to override this but I'm not sure why it's been removed.
CC @mnacamura
It looks like that was removed when separate window manager and desktop environment defaults were deprecated in favour of a single defaultSession
:
https://github.com/NixOS/nixpkgs/commit/8dc5ff7dcfd1c58c32004ffae25e6d31ed83d86c#diff-adb642202a7cc18b6bf16da112c9d39e95b5b576010cebbc3db2a7402a337066
CC @jtojnar
We do not set the default session in the config file any more, we replaced that in the same commit by a call to AccountsService:
I am not sure why it does not work for mini greeter.
I would guess it works after logging in with the gtk greeter because it will tell AccountsServer that user logged in into a certain session and the next time, the mini greeter will use the last used session it will obtain from AccountsService.
Ah, at present, mini doesn't do any work w/ trying to find a session - it relies solely on the lightdm's default session functionality...
Eventually I'd like to add session management if the user-session
is not set, but for now should I just add something like this to the nixos section of the README?
services.xserver.displayManager.lightdm.extraSeatDefaults = ''
user-session = awesome
''
Should I remove the bit that mentions setting windowManager.default = "awesome"
?
You can also use the following:
user-session = ${config.services.xserver.displayManager.defaultSession}
we could also do that in the NixOS module and assert that the default session is set like tiny greeter does.
Regarding the readme, note that services.xserver.windowManager.default = "awesome"
is deprecated. It should be replaced by services.xserver.displayManager.defaultSession = "none+awesome"
.
That option is not strictly required – it is meant to set the pre-selected session in session chooser, which is done for GDM and LightDM using the AccountsService API.
If the mini greeter does not have a session chooser than it does not make sense to set the option (unless using autologin, since it uses the same option to force the autologin session).
So in the short term, I would propose adding the extra config in the mini NixOS module, and then later, make the greeter crawl $XDG_DATA_DIRS
for .session
files and choose one of them, instead of falling back to default
session that might not exist.
I marked this as stale due to inactivity. → More info
Hi, don't really have time to look into this, sorry.
I marked this as stale due to inactivity. → More info
Hello,
so the trick with extraSeatDefaults = ''user-session = ${config.services.xserver.displayManager.defaultSession}'';
doesn't work anymore with tiny and slick greeters. It still logs "Cannot find session 'default'" to logs.
To fight this issue now you need to explicitly create a session, named "default".
services.xserver.displayManager = {
defaultSession = "default";
session = [
{
manage = "desktop";
name = "default";
start = ''exec openbox-session'';
}
];
}
This ugly fix works for both slick and tiny greeters and openbox session.
Just wanted to confirm that @wheelie-turner's solution is working for me with lighdm's tiny greeter and using awesomewm - just to help with any searches out there.
My config file entry:
services.xserver.displayManager = {
defaultSession = "default";
session = [
{
manage = "desktop";
name = "default";
start = ''exec awesome'';
}
];
lightdm = {
enable = true;
greeters = {
gtk.enable = false; #not sure if necessary, but it's true by default
tiny.enable = true;
};
};
};
Can confirm that this is also broken for none+herbstluftwm
but works for none+awesome
and none+xmonad
on the latest release (23.x).
Related for herbstluftwm
: I think I broke none+herbstluftwm
it with this fix: https://github.com/NixOS/nixpkgs/pull/237364
But I don't know what the correct solution should be to fix both use-cases.
Workaround:
windowManager = {
herbstluftwm.enable = true;
session = [{
name = "herbstluftwm";
# workaround for https://github.com/NixOS/nixpkgs/pull/237364
start = ''
${pkgs.herbstluftwm}/bin/herbstluftwm --locked 2>&1 > /tmp/herbstlog
'';
}];
};
Describe the bug A clear and concise description of what the bug is.
To Reproduce Steps to reproduce the behavior:
add the following to configuration.nix
display-manager.service
Expected behavior Lightdm-mini-greeter starts a
none+bspwm
sessionLogs
Additional context The same issue happened when trying
xfce+bspwm
too.Notify maintainers @mnacamura @prikhi
Metadata the same was occuring under 20.09 too prior to switching to unstable channel.