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, lib,
pkgs, pkgs,
... ...
}: }: let
with lib; let
cfg = config.modules.services.greetd; cfg = config.modules.services.greetd;
inherit (config.modules.other.system) username; uwsmEnabled = config.modules.services.uwsm.enable;
inherit (lib.options) mkOption mkEnableOption;
hyprlandConfig = pkgs.writeText "greetd-hyprland-config" '' inherit (lib.types) str listOf;
misc { inherit (lib.modules) mkIf;
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}
'';
in { in {
options.modules.services.greetd = { options.modules.services.greetd = {
enable = mkEnableOption "greetd"; enable = mkEnableOption "greetd";
greeter = mkOption { greeter = mkOption {
description = "greetd frontend to use"; description = "greetd frontend to use";
type = types.str; type = str;
}; };
launchOptions = mkOption { launchOptions = mkOption {
description = "/etc/greetd/environments as list of strings"; 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 { config = mkIf cfg.enable {
services.greetd = { services.greetd = {
enable = true; enable = true;
package = pkgs.greetd;
settings.default_session = { settings.default_session = {
command = "${ command = ''
pkgs.hyprland ${pkgs.greetd.tuigreet}/bin/tuigreet \
}/bin/Hyprland --config ${hyprlandConfig}"; -c '${cfg.session}' \
user = username; -r
-t --time-format "DD.MM.YYYY"
--asteriks'';
}; };
vt = 1;
}; };
environment.etc."greetd/environments".text =
concatStringsSep "\n" cfg.launchOptions;
}; };
} }