greetd.nix: fix

This commit is contained in:
Charlie Root 2025-04-06 21:23:05 +02:00
commit 2a145bb8d0
Signed by: faukah
SSH key fingerprint: SHA256:Uj2AXqvtdCA4hn5Hq0ZonhIAyUqI1q4w2sMG3Z1TH7E

View file

@ -3,58 +3,46 @@
lib,
pkgs,
...
}:
with lib; let
}: let
cfg = config.modules.services.greetd;
inherit (config.modules.other.system) username;
hyprlandConfig = pkgs.writeText "greetd-hyprland-config" ''
misc {
force_default_wallpaper=0
focus_on_activate=1
}
animations {
enabled=0
first_launch_animation=0
}
workspace=1,default:true,gapsout:0,gapsin:0,border:false,decorate:false
#exec-once=[workspace 1;fullscreen;noanim] ${
pkgs.greetd.${cfg.greeter}
}/bin/${cfg.greeter} -l; ${
pkgs.hyprland
}/bin/hyprctl dispatch exit
#exec-once=${
pkgs.hyprland
}/bin/hyprctl dispatch focuswindow ${cfg.greeter}
'';
uwsmEnabled = config.modules.services.uwsm.enable;
inherit (lib.options) mkOption mkEnableOption;
inherit (lib.types) str listOf;
inherit (lib.modules) mkIf;
in {
options.modules.services.greetd = {
enable = mkEnableOption "greetd";
greeter = mkOption {
description = "greetd frontend to use";
type = types.str;
type = str;
};
launchOptions = mkOption {
description = "/etc/greetd/environments as list of strings";
type = with types; listOf str;
type = listOf str;
};
session = mkOption {
description = "Which login session to start";
type = str;
default =
if uwsmEnabled
then "uwsm start Hyprland"
else "Hyprland";
};
};
config = mkIf cfg.enable {
services.greetd = {
enable = true;
package = pkgs.greetd;
settings.default_session = {
command = "${
pkgs.hyprland
}/bin/Hyprland --config ${hyprlandConfig}";
user = username;
command = ''
${pkgs.greetd.tuigreet}/bin/tuigreet \
-c '${cfg.session}' \
-r
-t --time-format "DD.MM.YYYY"
--asteriks'';
};
vt = 1;
};
environment.etc."greetd/environments".text =
concatStringsSep "\n" cfg.launchOptions;
};
}