2021-11-17 16:32:18 +01:00
|
|
|
{ pkgs, config, lib, ... }:
|
|
|
|
with lib;
|
|
|
|
let
|
|
|
|
cfg = config.eboskma.greetd;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
options.eboskma.greetd = {
|
|
|
|
enable = mkEnableOption "enable greetd";
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf (cfg.enable)
|
|
|
|
{
|
|
|
|
services.greetd = {
|
|
|
|
enable = true;
|
|
|
|
restart = true;
|
|
|
|
settings = {
|
|
|
|
default_session = {
|
|
|
|
command = "${pkgs.sway}/bin/sway --config /etc/greetd/sway-config";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2021-11-18 15:02:12 +01:00
|
|
|
environment.systemPackages = [ pkgs.greetd.gtkgreet ];
|
2021-11-17 16:32:18 +01:00
|
|
|
|
|
|
|
environment.etc = {
|
|
|
|
"greetd/sway-config" = {
|
|
|
|
text = ''
|
|
|
|
# `-l` activates layer-shell mode. Notice that `swaymsg exit` will run after gtkgreet.
|
|
|
|
exec "${pkgs.greetd.gtkgreet}/bin/gtkgreet -l; 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'
|
|
|
|
'';
|
|
|
|
user = "greeter";
|
|
|
|
group = "greeter";
|
|
|
|
};
|
|
|
|
"greetd/environments" = {
|
|
|
|
text = ''
|
|
|
|
${pkgs.sway}/bin/sway
|
|
|
|
${pkgs.bash}/bin/bash
|
|
|
|
'';
|
|
|
|
user = "greeter";
|
|
|
|
group = "greeter";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|