2024-10-13 12:54:12 +00:00
|
|
|
{
|
2024-12-18 18:24:59 +00:00
|
|
|
config,
|
2024-11-08 16:35:36 +00:00
|
|
|
inputs,
|
2024-10-13 12:54:12 +00:00
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
...
|
2024-12-13 18:02:53 +00:00
|
|
|
}:
|
|
|
|
# thanks https://git.jacekpoz.pl/poz/niksos/src/commit/f8d5e7ccd9c769f7c0b564f10dff419285e75248/modules/services/greetd.nix
|
|
|
|
let
|
2024-12-26 13:29:10 +00:00
|
|
|
inherit (lib) getExe getExe';
|
2024-12-13 18:02:53 +00:00
|
|
|
inherit (inputs.hyprland.packages.${pkgs.stdenv.system}) hyprland;
|
2024-11-08 16:35:36 +00:00
|
|
|
|
2024-12-13 18:02:53 +00:00
|
|
|
hyprctl = getExe' hyprland "hyprctl";
|
|
|
|
Hyprland = getExe' hyprland "Hyprland";
|
|
|
|
|
2024-12-27 15:11:25 +00:00
|
|
|
greeter = getExe pkgs.greetd.gtkgreet;
|
2024-12-13 18:02:53 +00:00
|
|
|
|
2024-12-27 15:11:25 +00:00
|
|
|
hyprlandConfig =
|
2024-12-26 13:29:10 +00:00
|
|
|
pkgs.writeText "greetd-hyprland-config"
|
|
|
|
''
|
|
|
|
misc {
|
|
|
|
force_default_wallpaper=0
|
|
|
|
focus_on_activate=1
|
|
|
|
}
|
2024-11-08 16:35:36 +00:00
|
|
|
|
2024-12-26 13:29:10 +00:00
|
|
|
animations {
|
|
|
|
enabled=0
|
|
|
|
first_launch_animation=0
|
|
|
|
}
|
2024-12-13 18:02:53 +00:00
|
|
|
|
2024-12-26 13:29:10 +00:00
|
|
|
workspace=1,default:true,gapsout:0,gapsin:0,border:false,decorate:false
|
2024-12-13 18:02:53 +00:00
|
|
|
|
2024-12-27 15:11:25 +00:00
|
|
|
exec-once=[workspace 1;fullscreen;noanim] ${greeter} -l; ${hyprctl} dispatch exit
|
2024-12-26 13:29:10 +00:00
|
|
|
exec-once=${hyprctl} dispatch focuswindow ${greeter}
|
|
|
|
'';
|
2024-12-13 18:02:53 +00:00
|
|
|
in {
|
|
|
|
services.greetd = {
|
2024-10-13 12:54:12 +00:00
|
|
|
enable = true;
|
2024-11-08 16:35:36 +00:00
|
|
|
settings = {
|
2024-12-13 18:02:53 +00:00
|
|
|
default_session = {
|
|
|
|
command = "${Hyprland} --config ${hyprlandConfig}";
|
2024-12-18 18:24:59 +00:00
|
|
|
user = config.local.systemVars.username;
|
2024-10-13 12:54:12 +00:00
|
|
|
};
|
2024-11-08 16:35:36 +00:00
|
|
|
};
|
|
|
|
};
|
2024-12-26 13:29:10 +00:00
|
|
|
|
|
|
|
programs.regreet = {
|
|
|
|
enable = true;
|
|
|
|
};
|
2024-11-21 22:34:23 +00:00
|
|
|
|
2024-10-15 14:45:59 +00:00
|
|
|
security.pam.services = {
|
|
|
|
greetd.enableGnomeKeyring = true;
|
2024-12-13 18:02:53 +00:00
|
|
|
login.enableGnomeKeyring = true;
|
2024-12-26 13:29:10 +00:00
|
|
|
gdm-password.enableGnomeKeyring = true;
|
2024-10-15 14:45:59 +00:00
|
|
|
greetd.fprintAuth = false;
|
|
|
|
};
|
2024-12-27 15:11:25 +00:00
|
|
|
|
|
|
|
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")
|
|
|
|
];
|
2024-10-13 12:54:12 +00:00
|
|
|
}
|