nixos/services/greetd: add conditional greetd/environments
This commit is contained in:
parent
46542a2c19
commit
408750a151
1 changed files with 17 additions and 12 deletions
|
@ -55,16 +55,21 @@ in {
|
||||||
greetd.fprintAuth = false;
|
greetd.fprintAuth = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.etc."greetd/environments".text = lib.strings.concatStringsSep "\n" [
|
environment.etc."greetd/environments".text = let
|
||||||
(
|
environments = [
|
||||||
lib.optionalString
|
{
|
||||||
config.programs.hyprland.enable
|
name = "Hyprland";
|
||||||
(
|
condition = with config.programs.hyprland; enable && !withUWSM;
|
||||||
if config.programs.hyprland.withUWSM
|
}
|
||||||
then "uwsm start -S hyprland-uwsm.desktop"
|
{
|
||||||
else "Hyprland"
|
name = "uwsm start -S hyprland-uwsm.desktop";
|
||||||
)
|
condition = with config.programs.hyprland; enable && withUWSM;
|
||||||
)
|
}
|
||||||
(lib.optionalString config.programs.sway.enable "sway")
|
{
|
||||||
];
|
name = "sway";
|
||||||
|
condition = config.programs.sway.enable;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
in
|
||||||
|
builtins.concatStringsSep "\n" (map (env: env.name) (builtins.filter (env: env.condition) environments));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue