7 cfg = config.programs.regreet;
8 settingsFormat = pkgs.formats.toml { };
11 options.programs.regreet = {
12 enable = lib.mkEnableOption null // {
14 Enable ReGreet, a clean and customizable greeter for greetd.
16 To use ReGreet, {option}`services.greetd` has to be enabled and
17 {option}`services.greetd.settings.default_session` should contain the
18 appropriate configuration to launch
19 {option}`config.programs.regreet.package`. For examples, see the
20 [ReGreet Readme](https://github.com/rharish101/ReGreet#set-as-default-session).
22 A minimal configuration that launches ReGreet in {command}`cage` is
23 enabled by this module by default.
27 package = lib.mkPackageOption pkgs [ "greetd" "regreet" ] { };
29 settings = lib.mkOption {
30 type = settingsFormat.type;
33 ReGreet configuration file. Refer
34 <https://github.com/rharish101/ReGreet/blob/main/regreet.sample.toml>
39 cageArgs = lib.mkOption {
40 type = lib.types.listOf lib.types.str;
42 example = lib.literalExpression
47 Additional arguments to be passed to
48 [cage](https://github.com/cage-kiosk/cage).
52 extraCss = lib.mkOption {
53 type = lib.types.either lib.types.path lib.types.lines;
56 Extra CSS rules to apply on top of the GTK theme. Refer to
57 [GTK CSS Properties](https://docs.gtk.org/gtk4/css-properties.html) for
58 modifiable properties.
63 package = lib.mkPackageOption pkgs "gnome-themes-extra" { } // {
65 The package that provides the theme given in the name option.
73 Name of the theme to use for regreet.
79 package = lib.mkPackageOption pkgs "adwaita-icon-theme" { } // {
81 The package that provides the icon theme given in the name option.
89 Name of the icon theme to use for regreet.
95 package = lib.mkPackageOption pkgs "cantarell-fonts" { } // {
97 The package that provides the font given in the name option.
101 name = lib.mkOption {
102 type = lib.types.str;
103 default = "Cantarell";
105 Name of the font to use for regreet.
109 size = lib.mkOption {
110 type = lib.types.ints.positive;
113 Size of the font to use for regreet.
119 package = lib.mkPackageOption pkgs "adwaita-icon-theme" { } // {
121 The package that provides the cursor theme given in the name option.
125 name = lib.mkOption {
126 type = lib.types.str;
129 Name of the cursor theme to use for regreet.
135 config = lib.mkIf cfg.enable {
136 environment.systemPackages = [
138 cfg.iconTheme.package
139 cfg.cursorTheme.package
142 fonts.packages = [ cfg.font.package ];
144 programs.regreet.settings.GTK = {
145 cursor_theme_name = cfg.cursorTheme.name;
146 font_name = "${cfg.font.name} ${toString cfg.font.size}";
147 icon_theme_name = cfg.iconTheme.name;
148 theme_name = cfg.theme.name;
152 enable = lib.mkDefault true;
153 settings.default_session.command = lib.mkDefault "${pkgs.dbus}/bin/dbus-run-session ${lib.getExe pkgs.cage} ${lib.escapeShellArgs cfg.cageArgs} -- ${lib.getExe cfg.package}";
157 "greetd/regreet.css" =
158 if lib.isPath cfg.extraCss
159 then {source = cfg.extraCss;}
160 else {text = cfg.extraCss;};
162 "greetd/regreet.toml".source =
163 settingsFormat.generate "regreet.toml" cfg.settings;
166 systemd.tmpfiles.settings."10-regreet" = let
169 group = config.users.users.${config.services.greetd.settings.default_session.user}.group;
173 "/var/log/regreet".d = defaultConfig;
174 "/var/cache/regreet".d = defaultConfig;