nixos/services/greetd: add conditional greetd/environments

This commit is contained in:
Anthony Rodriguez 2024-12-27 17:13:46 +01:00
parent 46542a2c19
commit 408750a151
Signed by: nezia
GPG key ID: EE3BE97C040A86CE

View file

@ -55,16 +55,21 @@ in {
greetd.fprintAuth = false;
};
environment.etc."greetd/environments".text = lib.strings.concatStringsSep "\n" [
(
lib.optionalString
config.programs.hyprland.enable
(
if config.programs.hyprland.withUWSM
then "uwsm start -S hyprland-uwsm.desktop"
else "Hyprland"
)
)
(lib.optionalString config.programs.sway.enable "sway")
];
environment.etc."greetd/environments".text = let
environments = [
{
name = "Hyprland";
condition = with config.programs.hyprland; enable && !withUWSM;
}
{
name = "uwsm start -S hyprland-uwsm.desktop";
condition = with config.programs.hyprland; enable && withUWSM;
}
{
name = "sway";
condition = config.programs.sway.enable;
}
];
in
builtins.concatStringsSep "\n" (map (env: env.name) (builtins.filter (env: env.condition) environments));
}