Skip to content

Commit

Permalink
nixos/greetd: use services.displayManager.sessionData.desktops
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagokokada committed Aug 10, 2024
1 parent 71a02fd commit f1369c6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
13 changes: 7 additions & 6 deletions nixos/desktop/greetd.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@
settings = {
default_session =
let
genSessionsFor =
path:
lib.concatStringsSep ":" (map (s: "${s}/${path}") config.services.displayManager.sessionPackages);
inherit (config.services.displayManager.sessionData) desktops;
in
{
command = lib.concatStringsSep " " [
Expand All @@ -37,9 +35,12 @@
"--remember-session"
"--time"
"--sessions"
# We can't know if the sessions inside sessionPackages are for
# X or Wayland, so add both to path
"${genSessionsFor "share/xsessions"}:${genSessionsFor "share/wayland-sessions"}"
"${lib.concatStringsSep ":" (
builtins.map (path: "${desktops}/${path}") [
"/share/xsessions"
"/share/wayland-sessions"
]
)}"
];
};
};
Expand Down
6 changes: 2 additions & 4 deletions overlays/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,7 @@ outputs.lib.recursiveMergeAttrs [
sx =
with prev;
sx.overrideAttrs (oldAttrs: {
postInstall = (
(oldAttrs.postInstall or "")
postInstall = (oldAttrs.postInstall or "")
+
#bash
''
Expand All @@ -99,8 +98,7 @@ outputs.lib.recursiveMergeAttrs [
exec = "sx";
}
}/share/applications/sx.desktop
''
);
'';

passthru = (oldAttrs.passhtru or { }) // {
providedSessions = [ "sx" ];
Expand Down

0 comments on commit f1369c6

Please sign in to comment.