Home-manager: xmonad with a displayManager won't work since 20.03

Created on 21 Apr 2020  路  5Comments  路  Source: nix-community/home-manager

Since 20.03, it looks like it is a requirement to define services.xserver.displayManager.defaultSession to none+xmonad to get xmonad working with autoLogin.

This setting only works if xmonad is already defined in configuration.nix using:

    services.xserver.windowManager.xmonad = true;

The issue is that I am defining the windowManager with home-manager:

 xsession = {
      enable = true;
      windowManager.xmonad.enable = true;
 };

I don't mind keeping a system configuration that uses xterm as the defaultSession but how can I change the value of services.xserver.displayManager.defaultSession to none+xmonad when the home-manager kicks in with the xmonad config ?

In other words, how can I make use of the displayManager with xmonad defined in the home-manager since 20.03 ?

Thanks for your help. I am totally confused by this.

Most helpful comment

It looks like it works indeed !

Thanks !

All 5 comments

I have

services.xserver.desktopManager.xterm.enable = true;

in my NixOS configuration with

xsession.windowManager.xmonad.enable = true;

in my HM configuration. This seems to work well in NixOS 20.03 as well. I haven't really looked into services.xserver.displayManager.defaultSession yet.

Thanks.

The problem arises when you want to autoLogin using the displayManager. I am using lightdm (the default one).

Since 20.03 autoLogin = true; seems to require services.xserver.displayManager.defaultSession to be set to a default existing session ("gnome", "xterm", "none+i3" or "none+xmonad").

I can set it to xterm but then I need a mean to set it back to none+xmonad in the home.nix config. Is there a way to do that ?

For now, it seems my best option is to move back the whole xmonad config in configuration.nix. If you have any suggestion/workaround to avoid that, I am ready to give it a try.

Right, I had a quick look at the related code in NixOS and don't quite understand how it all fits together. Would something like https://discourse.nixos.org/t/opening-i3-from-home-manager-automatically/4849/8 work?

It looks like it works indeed !

Thanks !

As an aside, but am I correct in assuming that if home-manager is installed on, say, Ubuntu, then it cannot manage display managers?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pmiddend picture pmiddend  路  3Comments

loewenheim picture loewenheim  路  7Comments

JonathanReeve picture JonathanReeve  路  8Comments

btomasini picture btomasini  路  4Comments

stites picture stites  路  3Comments