diff --git a/modules/nixos/greetd.nix b/modules/nixos/greetd.nix index fe1d159..9e1126b 100644 --- a/modules/nixos/greetd.nix +++ b/modules/nixos/greetd.nix @@ -3,17 +3,44 @@ lib, pkgs, ... -}: { +}: let + swayConfig = pkgs.writeText "greetd-sway-config" '' + input * { + xkb_layout "de" + xkb_options "caps:ctrl_modifier" + xkb_numlock "enable" + } + input "type:touchpad" { + tap "enable" + natural_scroll "enable" + } + + exec dbus-sway-environment + exec configure-gtk + # `-l` activates layer-shell mode. Notice that `swaymsg exit` will run after gtkgreet. + exec "${pkgs.greetd.regreet}/bin/regreet; swaymsg exit" + bindsym Mod4+shift+e exec swaynag \ + -t warning \ + -m 'What do you want to do?' \ + -b 'Poweroff' 'systemctl poweroff' \ + -b 'Reboot' 'systemctl reboot' + ''; +in { programs.regreet.enable = true; + users.users.greeter = { + isNormalUser = false; + description = "Greeter"; + extraGroups = []; + }; + services.greetd = { enable = true; - settings = rec { + settings = { initial_session = { - command = "${pkgs.greetd.regreet}/bin/regreet"; - user = "max"; + command = "${pkgs.sway}/bin/sway --config ${swayConfig}"; + user = "greeter"; }; - default_session = initial_session; }; };