media1: use UWSM for Hyprland session management
Matches the working pattern from gunter — UWSM properly sets up dbus and systemd targets, which is needed for PipeWire and xdg-desktop-portal. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -11,7 +11,7 @@ let
|
|||||||
p.inputstream-adaptive
|
p.inputstream-adaptive
|
||||||
]);
|
]);
|
||||||
|
|
||||||
hyprlandConfig = pkgs.writeText "hyprland.conf" ''
|
hyprlandConfig = ''
|
||||||
# Monitor — auto-detect, native resolution
|
# Monitor — auto-detect, native resolution
|
||||||
monitor = , preferred, auto, 1
|
monitor = , preferred, auto, 1
|
||||||
|
|
||||||
@@ -54,31 +54,37 @@ let
|
|||||||
disable_splash_rendering = true
|
disable_splash_rendering = true
|
||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
launchHyprland = pkgs.writeShellApplication {
|
|
||||||
name = "launch-hyprland";
|
|
||||||
runtimeInputs = [ pkgs.hyprland ];
|
|
||||||
text = ''
|
|
||||||
export XDG_SESSION_TYPE=wayland
|
|
||||||
exec Hyprland --config ${hyprlandConfig}
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
# Hyprland compositor
|
# Hyprland compositor with UWSM for proper dbus/systemd session management
|
||||||
programs.hyprland.enable = true;
|
programs.hyprland = {
|
||||||
|
enable = true;
|
||||||
|
withUWSM = true;
|
||||||
|
portalPackage = pkgs.xdg-desktop-portal-hyprland;
|
||||||
|
};
|
||||||
|
|
||||||
# greetd for auto-login into Hyprland
|
# greetd for auto-login — UWSM starts Hyprland as a systemd session
|
||||||
services.greetd = {
|
services.greetd = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings = {
|
settings = {
|
||||||
default_session = {
|
default_session = {
|
||||||
command = lib.getExe launchHyprland;
|
command = "uwsm start hyprland-uwsm.desktop";
|
||||||
user = "kodi";
|
user = "kodi";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Deploy Hyprland config to kodi user's XDG config dir
|
||||||
|
systemd.tmpfiles.rules = [
|
||||||
|
"d /home/kodi/.config/hypr 0755 kodi kodi -"
|
||||||
|
];
|
||||||
|
environment.etc."skel/hypr/hyprland.conf".text = hyprlandConfig;
|
||||||
|
system.activationScripts.hyprlandConfig = lib.stringAfter [ "users" ] ''
|
||||||
|
install -D -o kodi -g kodi -m 0644 /dev/stdin /home/kodi/.config/hypr/hyprland.conf <<'HYPRCONF'
|
||||||
|
${hyprlandConfig}
|
||||||
|
HYPRCONF
|
||||||
|
'';
|
||||||
|
|
||||||
# Kodi user
|
# Kodi user
|
||||||
users.users.kodi = {
|
users.users.kodi = {
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user