displayManager not launching herbstluftwm

Hi! Been a NixOS user since 21.11 I believe, but still consider myself new.

I recently just upgraded my system from 23.05 to unstable, and somehow broke my system. I am not able to log into herbstluftwm anymore through a displayManager. startx works however.

I switched display managers from lightdm to sddm, same problem.
I installed a different window manager (Hypr) and both lightdm and sddm are able to load Hypr without problems.

systemctl status display-manager.service didn’t give me much clue either.

● display-manager.service - Display Manager
     Loaded: loaded (/etc/systemd/system/display-manager.service; linked; preset: enabled)
     Active: active (running) since Tue 2023-10-24 18:51:59 CDT; 16min ago
    Process: 1452 ExecStartPre=/nix/store/3fb0adsar0ywfncs7rfzh86nf2l6asa7-unit-script-display-manager-pre-start/bin/display-manager-pre-start (code=exited, status=0/SUCCESS)
   Main PID: 1455 (lightdm)
         IP: 0B in, 0B out
         IO: 103.8M read, 452.0K written
      Tasks: 13 (limit: 19090)
     Memory: 145.9M
        CPU: 1.226s
     CGroup: /system.slice/display-manager.service
             ├─1455 /nix/store/143vkxwcxni8wwli0wwkadr8v2p4qlpb-lightdm-1.32.0/sbin/lightdm
             ├─1756 /nix/store/h0gmbxjjvw85dhzgr1g003d4xpq21kag-xorg-server-21.1.8/bin/X -config /nix/store/v6pwjdr69g8snaazv6vin58b9mzmbj7h-xserver.conf -xkbdir /nix/store/096yg7fc67py86w0bm6g7a32npgyh5ic-xkeyboard-config-2.39/etc/X11/xkb -verbose>
             └─1801 lightdm --session-child 13 20

Oct 24 18:51:59 centaur systemd[1]: Starting Display Manager...
Oct 24 18:51:59 centaur systemd[1]: Started Display Manager.
Oct 24 18:52:00 centaur lightdm[1492]: pam_unix(lightdm-autologin:session): session opened for user terrorgen(uid=1000) by (uid=0)
Oct 24 18:52:00 centaur lightdm[1492]: gkr-pam: gnome-keyring-daemon started properly
Oct 24 18:52:00 centaur lightdm[1492]: pam_unix(lightdm-autologin:session): session closed for user terrorgen
Oct 24 18:52:07 centaur lightdm[1601]: gkr-pam: unable to locate daemon control file
Oct 24 18:52:07 centaur lightdm[1601]: gkr-pam: stashed password to try later in open session
Oct 24 18:52:07 centaur lightdm[1601]: pam_unix(lightdm:session): session opened for user terrorgen(uid=1000) by (uid=0)
Oct 24 18:52:07 centaur lightdm[1601]: gkr-pam: gnome-keyring-daemon started properly and unlocked keyring
Oct 24 18:52:07 centaur lightdm[1601]: pam_unix(lightdm:session): session closed for user terrorgen

my flake.lock

{
  "nodes": {
    "base16-schemes": {
      "flake": false,
      "locked": {
        "lastModified": 1689473676,
        "narHash": "sha256-L0RhUr9+W5EPWBpLcmkKpUeCEWRs/kLzVMF3Vao2ZU0=",
        "owner": "tinted-theming",
        "repo": "base16-schemes",
        "rev": "d95123ca6377cd849cfdce92c0a24406b0c6a789",
        "type": "github"
      },
      "original": {
        "owner": "tinted-theming",
        "repo": "base16-schemes",
        "type": "github"
      }
    },
    "home-manager": {
      "inputs": {
        "nixpkgs": [
          "nixpkgs"
        ]
      },
      "locked": {
        "lastModified": 1697838989,
        "narHash": "sha256-hwVlO+st8vWJO6iy3/JbMHrUyY4Ak7xUSmffoWqBPUg=",
        "owner": "nix-community",
        "repo": "home-manager",
        "rev": "ae631b0b20f06f7d239d160723d228891ddb2fe0",
        "type": "github"
      },
      "original": {
        "owner": "nix-community",
        "ref": "master",
        "repo": "home-manager",
        "type": "github"
      }
    },
    "nix-colors": {
      "inputs": {
        "base16-schemes": "base16-schemes",
        "nixpkgs-lib": "nixpkgs-lib"
      },
      "locked": {
        "lastModified": 1695388192,
        "narHash": "sha256-2jelpE7xK+4M7jZNyWL7QYOYegQLYBDQS5bvdo8XRUQ=",
        "owner": "misterio77",
        "repo": "nix-colors",
        "rev": "37227f274b34a3b51649166deb94ce7fec2c6a4c",
        "type": "github"
      },
      "original": {
        "owner": "misterio77",
        "repo": "nix-colors",
        "type": "github"
      }
    },
    "nixpkgs": {
      "locked": {
        "lastModified": 1697723726,
        "narHash": "sha256-SaTWPkI8a5xSHX/rrKzUe+/uVNy6zCGMXgoeMb7T9rg=",
        "owner": "NixOS",
        "repo": "nixpkgs",
        "rev": "7c9cc5a6e5d38010801741ac830a3f8fd667a7a0",
        "type": "github"
      },
      "original": {
        "owner": "NixOS",
        "ref": "nixos-unstable",
        "repo": "nixpkgs",
        "type": "github"
      }
    },
    "nixpkgs-lib": {
      "locked": {
        "lastModified": 1694911725,
        "narHash": "sha256-8YqI+YU1DGclEjHsnrrGfqsQg3Wyga1DfTbJrN3Ud0c=",
        "owner": "nix-community",
        "repo": "nixpkgs.lib",
        "rev": "819180647f428a3826bfc917a54449da1e532ce0",
        "type": "github"
      },
      "original": {
        "owner": "nix-community",
        "repo": "nixpkgs.lib",
        "type": "github"
      }
    },
    "root": {
      "inputs": {
        "home-manager": "home-manager",
        "nix-colors": "nix-colors",
        "nixpkgs": "nixpkgs"
      }
    }
  },
  "root": "root",
  "version": 7
}

I have both services.xserver.windowManager.herbstluftwm.enable = true; outside of Home Manager and xsession.windowManager.herbstluftwm.enable = true; in Home Manager.

Any help would be appreciated!

Hi @terrorgen

I think I had the same or similar problem. After upgrading to 23.11 my none+herbstluftwm session wouldn’t start from lightdm or sddm. I could make it work using startx and a custom .xinitrc file. So my workaround is to add this custom session start script to my nixos config:

displayManager = {
  session = [
    { manage = "desktop";
      name = "herbstluft";
      start = ''
        ${pkgs.herbstluftwm}/bin/herbstluftwm --locked &
        waitPID=$!
      '';
    }
  ];
  defaultSession = "herbstluft";
};

Perhaps it helps.

1 Like

@eikek I used your code, and it worked, and I am so so grateful.

I moved everything but defaultSession to services.xsession on 24.05 and that did the trick :pray::pray::pray::heartbeat::partying_face::dancer:t2::nail_care: