Skip to content

Commit

Permalink
Added checking for session names for jovian.steam.defaultSession
Browse files Browse the repository at this point in the history
This checks for desktop session names for jovian.steam.desktopSession. It tells you if the input is in the list of valid names that the system accepts, and also checks if the option is unset, in which case it will default to gamescope-wayland.
  • Loading branch information
imadnyc committed Nov 9, 2023
1 parent fd77539 commit d8b92a0
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion modules/steam/autostart.nix
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,15 @@ in
};

desktopSession = mkOption {
type = types.nullOr types.str;
type = with types ; nullOr str // {
check = userProvidedDesktopSession:
lib.assertMsg (userProvidedDesktopSession != null -> (str.check userProvidedDesktopSession && lib.elem userProvidedDesktopSession config.services.xserver.displayManager.sessionData.sessionNames)) ''
Desktop session '${userProvidedDesktopSession}' not found.
Valid values for 'jovian.steam.desktopSession' are:
${lib.concatStringsSep "\n " (lib.lists.remove "gamescope-wayland" config.services.xserver.displayManager.sessionData.sessionNames)}
If you don't want a desktop session to switch to, remove 'jovian.steam.desktopSession' from your config.
'';
};
default = null;
example = "plasma";
description = lib.mdDoc ''
Expand Down

0 comments on commit d8b92a0

Please sign in to comment.