config.nix/modules/desktop/display-manager.nix

64 lines
1.3 KiB
Nix

{
config,
pkgs,
lib,
inputs,
...
}:
{
services = {
xserver = {
xkb = {
layout = builtins.substring 0 2 config.system.locale;
variant = "";
};
};
power-profiles-daemon = {
enable = true;
};
upower = {
enable = true;
};
displayManager = {
gdm = {
enable = true;
autoSuspend = false;
};
};
};
programs = {
uwsm = {
waylandCompositors = {
hyprland =
if config.desktop.window-managers.hyprland.enable then
{
prettyName = "Hyprland";
comment = "Hyprland";
binPath = "${config.programs.hyprland.package}/bin/start-hyprland";
}
else
{ };
sway =
if config.desktop.window-managers.sway.enable then
{
prettyName = "Sway";
comment = "Sway";
binPath = "${config.programs.sway.package}/bin/sway --session";
}
else
{ };
niri =
if config.desktop.window-managers.niri.enable then
{
prettyName = "Niri";
comment = "Niri";
binPath = "${config.programs.niri.package}/bin/niri-session";
}
else
{ };
};
};
};
xdg.portal.enable = true;
}