Greetd: Difference between revisions
m Reorganized and added ReGreet |
Use new options for regreet |
||
| (One intermediate revision by one other user not shown) | |||
| Line 49: | Line 49: | ||
Installation is as simple as enabling it within your configuration. | Installation is as simple as enabling it within your configuration. | ||
{{File|3=programs.regreet.enable = true;|name=/etc/nixos/configuration.nix|lang=nix}} | {{File|3=programs.regreet.enable = true; # 26.05 and earlier | ||
services.displayManager.regreet.enable = true; # 26.11 and later | |||
|name=/etc/nixos/configuration.nix|lang=nix}} | |||
You can also style and configure ReGreet through Nix easily. | You can also style and configure ReGreet through Nix easily. | ||
{{File|3= | {{File|3=services.displayManager.regreet = { | ||
enable = true; | enable = true; | ||
# For this example you'd need to have a version of Adwaita and the font Cantarell installed | # For this example you'd need to have a version of Adwaita and the font Cantarell installed | ||
| Line 65: | Line 67: | ||
== Automatic startup == | == Automatic startup == | ||
In this minimal example, the Wayland compositor [[Sway]] automatically gets executed by the user <code>myuser</code> after | In this minimal example, the Wayland compositor [[Sway]] automatically gets executed by the user <code>myuser</code> after successful boot, no password required: | ||
{{file|/etc/nixos/configuration.nix|nix|<nowiki> | {{file|/etc/nixos/configuration.nix|nix|<nowiki> | ||
Latest revision as of 18:27, 1 December 2026
greetd is a minimal and flexible login manager daemon.
Greeters
GTKGreet
Using this configuration, greetd will use the greeter gtkgreet, asking for user, password and which session to start as defined in the /etc/greetd/environments file:
{ config, lib, pkgs, ... }:
let
swayConfig = pkgs.writeText "greetd-sway-config" ''
# `-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'
'';
in
{
services.greetd = {
enable = true;
settings = {
default_session = {
command = "${pkgs.sway}/bin/sway --config ${swayConfig}";
};
};
};
environment.etc."greetd/environments".text = ''
sway
fish
bash
startxfce4
'';
}
If you're hosting gtkgreet in a Wayland compositor, there is a known issue, between GTK portals and dbus, of a delay before the greeter appears,. There are a couple known workarounds depending on the compositor you're using:
ReGreet
ReGreet is a clean and customizable GTK-based greetd greeter written in Rust. It is meant to be run under a Wayland compositor, such as Sway. Configuration options may be found under programs.regreet.
Installation is as simple as enabling it within your configuration.
programs.regreet.enable = true; # 26.05 and earlier
services.displayManager.regreet.enable = true; # 26.11 and later
You can also style and configure ReGreet through Nix easily.
services.displayManager.regreet = {
enable = true;
# For this example you'd need to have a version of Adwaita and the font Cantarell installed
theme.name = "Adwaita";
font = {
name = "Cantarell";
size = 16;
};
cursorTheme.name = "Adwaita";
};
Automatic startup
In this minimal example, the Wayland compositor Sway automatically gets executed by the user myuser after successful boot, no password required:
services.greetd = {
enable = true;
settings = rec {
initial_session = {
command = "${pkgs.sway}/bin/sway";
user = "myuser";
};
default_session = initial_session;
};
};
initial_session is executed automatically. If you just define default_session, greetd will ask for a password and execute command with user myuser.