nixosMod/improvedDef/wayland: export services.wayland.enable result

main
Felix Stupp 2 months ago
parent 539680512c
commit 77d85d1a09
Signed by: zocker
GPG Key ID: 93E1BD26F6B02FB7

@ -5,16 +5,29 @@
... ...
}: }:
let let
prgs = config.programs;
servDM = config.services.desktopManager;
xDM = config.services.xserver.desktopManager;
cfg = config.x-banananetwork.improvedDefaults; cfg = config.x-banananetwork.improvedDefaults;
in in
{ {
config = lib.mkIf cfg.enable ( options = {
let
prgs = config.programs; services.wayland.enable = lib.mkEnableOption ''
servDM = config.services.desktopManager; sensible defaults for Wayland sessions.
xDM = config.services.xserver.desktopManager;
waylandEnabled = builtins.any (x: x) ([ Be aware that a Wayland compositor or desktop environment is not enabled automatically
as there is no main implementation of Wayland.
'';
};
config = lib.mkMerge [
(lib.mkIf (cfg.enable) {
# auto detect if a wayland compatible compositor is already enabled
services.wayland.enable = builtins.any (x: x) ([
prgs.hyprland.enable prgs.hyprland.enable
prgs.miriway.enable prgs.miriway.enable
prgs.river.enable prgs.river.enable
@ -24,13 +37,19 @@ in
servDM.lomiri.enable # unsure wheather this is using Wayland servDM.lomiri.enable # unsure wheather this is using Wayland
servDM.plasma6.enable servDM.plasma6.enable
]); ]);
in })
{
(lib.mkIf (config.services.wayland.enable) {
# make Steam Input events possible
programs.steam.extest.enable = lib.mkIf config.programs.steam.enable true;
warnings = lib.mkIf (xDM.mate.enable && !xDM.mate.enableWaylandSession) [
"Wayland & Mate are enabled, but Mates Wayland support is disabled, you should enable services.xserver.displayManager.enableWaylandSession"
];
# make Steam Input events on Wayland possible })
programs.steam.extest.enable = lib.mkIf (config.programs.steam.enable && waylandEnabled) true;
} ];
);
} }

Loading…
Cancel
Save