Skip to content

Conversation

@khaneliman
Copy link
Contributor

@khaneliman khaneliman commented Jan 9, 2026

Fix issue with displayManager defaultSession not accepting the string since it's missing from the lookup it does with
passthru.providedSessions.

Related #474174 (comment)

services.displayManager.defaultSession uses this passthru

defaultSession = lib.mkOption {
type = lib.types.nullOr lib.types.str // {
description = "session name";
check =
d:
lib.assertMsg (d != null -> (lib.types.str.check d && lib.elem d cfg.sessionData.sessionNames)) ''
Default graphical session, '${d}', not found.
Valid names for 'services.displayManager.defaultSession' are:
${lib.concatStringsSep "\n " cfg.sessionData.sessionNames}
'';
};

services.displayManager.sessionData = {
desktops = installedSessions;
sessionNames = lib.concatMap (p: p.providedSessions) cfg.sessionPackages;
# We do not want to force users to set defaultSession when they have only single DE.
autologinSession =
if cfg.defaultSession != null then
cfg.defaultSession
else if cfg.sessionData.sessionNames != [ ] then
lib.head cfg.sessionData.sessionNames
else
null;
};

Things done

  • Built on platform:
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • Package update: when the change is major or breaking.
  • NixOS Release Notes
    • Module addition: when adding a new NixOS module.
    • Module update: when the change is significant.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other READMEs.

Add a 👍 reaction to pull requests you find important.

Fix issue with displayManager `defaultSession` not accepting the string
since it's missing from the lookup it does with
`passthru.providedSessions`.

Signed-off-by: Austin Horstman <[email protected]>
@khaneliman khaneliman requested a review from fufexan January 9, 2026 17:06
@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. 11.by: package-maintainer This PR was created by a maintainer of all the package it changes. 2.status: merge-bot eligible This PR can be merged by commenting "@NixOS/nixpkgs-merge-bot merge". labels Jan 9, 2026
Copy link
Contributor

@fufexan fufexan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't even know about this missing piece of the puzzle, LGTM.

@nixpkgs-ci nixpkgs-ci bot added 12.approvals: 1 This PR was reviewed and approved by one person. 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in any of the changed packages. labels Jan 9, 2026
@rhoriguchi
Copy link
Contributor

@khaneliman
Copy link
Contributor Author

This should also be upstreamed https://github.com/hyprwm/Hyprland/blob/fa41c8229d46d655bbd3128c0a3844a8d4615c13/nix/default.nix#L233

Sure, created a PR

@nixpkgs-ci nixpkgs-ci bot added 12.approvals: 2 This PR was reviewed and approved by two persons. and removed 12.approvals: 1 This PR was reviewed and approved by one person. labels Jan 9, 2026
@khaneliman khaneliman added this pull request to the merge queue Jan 10, 2026
Merged via the queue into NixOS:master with commit f21b526 Jan 10, 2026
40 of 42 checks passed
@khaneliman khaneliman deleted the hyprland branch January 10, 2026 04:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2.status: merge-bot eligible This PR can be merged by commenting "@NixOS/nixpkgs-merge-bot merge". 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. 11.by: package-maintainer This PR was created by a maintainer of all the package it changes. 12.approvals: 2 This PR was reviewed and approved by two persons. 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in any of the changed packages.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants