2022-08-18 05:19:26 +02:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
ldmcfg = config.services.xserver.displayManager.lightdm;
|
|
|
|
cfg = ldmcfg.greeters.slick;
|
|
|
|
|
|
|
|
inherit (pkgs) writeText;
|
|
|
|
|
|
|
|
theme = cfg.theme.package;
|
|
|
|
icons = cfg.iconTheme.package;
|
|
|
|
font = cfg.font.package;
|
2022-12-03 03:26:46 +01:00
|
|
|
cursors = cfg.cursorTheme.package;
|
2022-08-18 05:19:26 +02:00
|
|
|
|
|
|
|
slickGreeterConf = writeText "slick-greeter.conf" ''
|
|
|
|
[Greeter]
|
|
|
|
background=${ldmcfg.background}
|
|
|
|
theme-name=${cfg.theme.name}
|
|
|
|
icon-theme-name=${cfg.iconTheme.name}
|
|
|
|
font-name=${cfg.font.name}
|
2022-12-03 03:26:46 +01:00
|
|
|
cursor-theme-name=${cfg.cursorTheme.name}
|
|
|
|
cursor-theme-size=${toString cfg.cursorTheme.size}
|
2022-08-18 05:19:26 +02:00
|
|
|
draw-user-backgrounds=${boolToString cfg.draw-user-backgrounds}
|
|
|
|
${cfg.extraConfig}
|
|
|
|
'';
|
|
|
|
in
|
|
|
|
{
|
|
|
|
options = {
|
|
|
|
services.xserver.displayManager.lightdm.greeters.slick = {
|
2022-08-20 11:18:12 +02:00
|
|
|
enable = mkEnableOption (lib.mdDoc "lightdm-slick-greeter as the lightdm greeter");
|
2022-08-18 05:19:26 +02:00
|
|
|
|
|
|
|
theme = {
|
|
|
|
package = mkOption {
|
|
|
|
type = types.package;
|
|
|
|
default = pkgs.gnome.gnome-themes-extra;
|
|
|
|
defaultText = literalExpression "pkgs.gnome.gnome-themes-extra";
|
|
|
|
description = lib.mdDoc ''
|
|
|
|
The package path that contains the theme given in the name option.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
name = mkOption {
|
|
|
|
type = types.str;
|
|
|
|
default = "Adwaita";
|
|
|
|
description = lib.mdDoc ''
|
|
|
|
Name of the theme to use for the lightdm-slick-greeter.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
iconTheme = {
|
|
|
|
package = mkOption {
|
|
|
|
type = types.package;
|
|
|
|
default = pkgs.gnome.adwaita-icon-theme;
|
|
|
|
defaultText = literalExpression "pkgs.gnome.adwaita-icon-theme";
|
|
|
|
description = lib.mdDoc ''
|
|
|
|
The package path that contains the icon theme given in the name option.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
name = mkOption {
|
|
|
|
type = types.str;
|
|
|
|
default = "Adwaita";
|
|
|
|
description = lib.mdDoc ''
|
|
|
|
Name of the icon theme to use for the lightdm-slick-greeter.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
font = {
|
|
|
|
package = mkOption {
|
|
|
|
type = types.package;
|
|
|
|
default = pkgs.ubuntu_font_family;
|
|
|
|
defaultText = literalExpression "pkgs.ubuntu_font_family";
|
|
|
|
description = lib.mdDoc ''
|
|
|
|
The package path that contains the font given in the name option.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
name = mkOption {
|
|
|
|
type = types.str;
|
|
|
|
default = "Ubuntu 11";
|
|
|
|
description = lib.mdDoc ''
|
|
|
|
Name of the font to use.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2022-12-03 03:26:46 +01:00
|
|
|
cursorTheme = {
|
|
|
|
package = mkOption {
|
|
|
|
type = types.package;
|
|
|
|
default = pkgs.gnome.adwaita-icon-theme;
|
|
|
|
defaultText = literalExpression "pkgs.gnome.adwaita-icon-theme";
|
|
|
|
description = lib.mdDoc ''
|
|
|
|
The package path that contains the cursor theme given in the name option.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
name = mkOption {
|
|
|
|
type = types.str;
|
|
|
|
default = "Adwaita";
|
|
|
|
description = lib.mdDoc ''
|
|
|
|
Name of the cursor theme to use for the lightdm-slick-greeter.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
size = mkOption {
|
|
|
|
type = types.int;
|
|
|
|
default = 24;
|
|
|
|
description = lib.mdDoc ''
|
|
|
|
Size of the cursor theme to use for the lightdm-slick-greeter.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2022-08-18 05:19:26 +02:00
|
|
|
draw-user-backgrounds = mkEnableOption (lib.mdDoc "draw user backgrounds");
|
|
|
|
|
|
|
|
extraConfig = mkOption {
|
|
|
|
type = types.lines;
|
|
|
|
default = "";
|
|
|
|
description = lib.mdDoc ''
|
|
|
|
Extra configuration that should be put in the lightdm-slick-greeter.conf
|
|
|
|
configuration file.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf (ldmcfg.enable && cfg.enable) {
|
|
|
|
services.xserver.displayManager.lightdm = {
|
|
|
|
greeters.gtk.enable = false;
|
|
|
|
greeter = mkDefault {
|
|
|
|
package = pkgs.lightdm-slick-greeter.xgreeters;
|
|
|
|
name = "lightdm-slick-greeter";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
environment.systemPackages = [
|
2022-12-03 03:26:46 +01:00
|
|
|
cursors
|
2022-08-18 05:19:26 +02:00
|
|
|
icons
|
|
|
|
theme
|
|
|
|
];
|
|
|
|
|
2023-07-19 13:43:36 +02:00
|
|
|
fonts.packages = [ font ];
|
2022-08-18 05:19:26 +02:00
|
|
|
|
|
|
|
environment.etc."lightdm/slick-greeter.conf".source = slickGreeterConf;
|
|
|
|
};
|
|
|
|
}
|