Use greetd to start sway

This commit is contained in:
Jakob Lechner 2025-06-21 22:32:14 +02:00
parent 29525dc308
commit c243056027
3 changed files with 39 additions and 15 deletions

View file

@ -11,6 +11,29 @@ lib.mkIf (config.jalr.gui.enable && config.jalr.gui.desktop == "sway") {
};
};
services.greetd = {
enable = true;
settings =
let
command = pkgs.writeShellScript "sway-init" ''
systemctl --user import-environment PATH
systemctl --user restart xdg-desktop-portal.service
exec ${pkgs.sway}/bin/sway
'';
user = "jalr";
in
{
default_session = {
inherit command;
inherit user;
};
initial_session = {
inherit command;
inherit user;
};
};
};
hardware.graphics.enable = true;
security.polkit.enable = true;
@ -26,9 +49,9 @@ lib.mkIf (config.jalr.gui.enable && config.jalr.gui.desktop == "sway") {
icons.enable = true;
portal = {
enable = true;
extraPortals = with pkgs; [
xdg-desktop-portal-wlr
xdg-desktop-portal-gtk
wlr.enable = true;
extraPortals = [
pkgs.xdg-desktop-portal-gtk
];
xdgOpenUsePortal = true;
};