1 { config, lib, pkgs, ... }:
7 dmcfg = config.services.xserver.displayManager;
8 ldmcfg = dmcfg.lightdm;
9 xcfg = config.services.xserver;
10 cfg = ldmcfg.greeters.gtk;
12 inherit (pkgs) writeText;
14 theme = cfg.theme.package;
15 icons = cfg.iconTheme.package;
16 cursors = cfg.cursorTheme.package;
18 gtkGreeterConf = writeText "lightdm-gtk-greeter.conf"
21 theme-name = ${cfg.theme.name}
22 icon-theme-name = ${cfg.iconTheme.name}
23 cursor-theme-name = ${cfg.cursorTheme.name}
24 cursor-theme-size = ${toString cfg.cursorTheme.size}
25 background = ${ldmcfg.background}
26 ${optionalString (cfg.clock-format != null) "clock-format = ${cfg.clock-format}"}
27 ${optionalString (cfg.indicators != null) "indicators = ${concatStringsSep ";" cfg.indicators}"}
28 ${optionalString (xcfg.dpi != null) "xft-dpi=${toString xcfg.dpi}"}
36 services.xserver.displayManager.lightdm.greeters.gtk = {
42 Whether to enable lightdm-gtk-greeter as the lightdm greeter.
50 default = pkgs.gnome-themes-extra;
51 defaultText = literalExpression "pkgs.gnome-themes-extra";
53 The package path that contains the theme given in the name option.
61 Name of the theme to use for the lightdm-gtk-greeter.
71 default = pkgs.adwaita-icon-theme;
72 defaultText = literalExpression "pkgs.adwaita-icon-theme";
74 The package path that contains the icon theme given in the name option.
82 Name of the icon theme to use for the lightdm-gtk-greeter.
92 default = pkgs.adwaita-icon-theme;
93 defaultText = literalExpression "pkgs.adwaita-icon-theme";
95 The package path that contains the cursor theme given in the name option.
103 Name of the cursor theme to use for the lightdm-gtk-greeter.
111 Size of the cursor theme to use for the lightdm-gtk-greeter.
116 clock-format = mkOption {
117 type = types.nullOr types.str;
121 Clock format string (as expected by strftime, e.g. "%H:%M")
122 to use with the lightdm gtk greeter panel.
124 If set to null the default clock format is used.
128 indicators = mkOption {
129 type = types.nullOr (types.listOf types.str);
131 example = [ "~host" "~spacer" "~clock" "~spacer" "~session" "~language" "~a11y" "~power" ];
133 List of allowed indicator modules to use for the lightdm gtk
136 Built-in indicators include "~a11y", "~language", "~session",
137 "~power", "~clock", "~host", "~spacer". Unity indicators can be
138 represented by short name (e.g. "sound", "power"), service file name,
141 If set to null the default indicators are used.
145 extraConfig = mkOption {
149 Extra configuration that should be put in the lightdm-gtk-greeter.conf
158 config = mkIf (ldmcfg.enable && cfg.enable) {
160 services.xserver.displayManager.lightdm.greeter = mkDefault {
161 package = pkgs.lightdm-gtk-greeter.xgreeters;
162 name = "lightdm-gtk-greeter";
165 environment.systemPackages = [
171 environment.etc."lightdm/lightdm-gtk-greeter.conf".source = gtkGreeterConf;