Skip to content
This repository has been archived by the owner on Feb 21, 2024. It is now read-only.

Session that attempts to launch user session #102

Merged
merged 1 commit into from
Oct 4, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions module/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,37 @@ let
lanzaboote = import sources.lanzaboote;

inherit (sources) impermanence;

startupUser = pkgs.writeShellApplication {
name = "startupUser";
runtimeInputs = [ ];
# Might want to have a few more user friendly and user configurable
# fallbacks before /bin/sh.
text = ''exec "''${USER_ENTRY:-/bin/sh}"'';
};

defaultingUser = (pkgs.writeTextDir "share/wayland-sessions/Default.desktop" ''
[Desktop Entry]
Name=Default
Comment=User defaulting desktop environment
Exec=${startupUser}/bin/startupUser
TryExec=${startupUser}/bin/startupUser
Type=Application
'') // {
providedSessions = [ "Default" ];
};

fallback = (pkgs.writeTextDir "share/wayland-sessions/Fallback.desktop" ''
[Desktop Entry]
Name=Fallback
Comment=Fallback desktop environment
Exec=/bin/sh
TryExec=/bin/sh
Type=Application
'') // {
providedSessions = [ "Fallback" ];
};

in
{
imports = [
Expand Down Expand Up @@ -263,6 +294,15 @@ in
};
};

services.xserver.displayManager.sessionPackages = [
# Here for most login managers who know to check $XDG_DATA_DIRS/share/{xsessions, wayland-sessions}
# Of the greeters the one that checks using XDG_DATA_DIRS (probably) are qtgreetd and regreet.
# Most of the rest of the greeters I know of dont check for sessions files and dont provide selectable options
# Or they check the static paths /usr/share/{xsessions, wayland-sessions}
defaultingUser
fallback
];

# NOTE: This option should help with offline rebuilds, but it has the
# downside of taking a whole lot of space.
# https://search.nixos.org/options?show=system.includeBuildDependencies
Expand Down