blob: ba8151a60f201f435d83018d05d9bdbb727ba77f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
|
{ config, lib, pkgs, ... }:
with lib;
let
dmcfg = config.services.xserver.displayManager;
ldmcfg = dmcfg.lightdm;
cfg = ldmcfg.greeters.mini;
xgreeters = pkgs.linkFarm "lightdm-mini-greeter-xgreeters" [{
path = "${pkgs.lightdm-mini-greeter}/share/xgreeters/lightdm-mini-greeter.desktop";
name = "lightdm-mini-greeter.desktop";
}];
miniGreeterConf = pkgs.writeText "lightdm-mini-greeter.conf"
''
[greeter]
user = ${cfg.user}
show-password-label = true
password-label-text = Password:
show-input-cursor = true
[greeter-hotkeys]
mod-key = meta
shutdown-key = s
restart-key = r
hibernate-key = h
suspend-key = u
[greeter-theme]
font = Sans
font-size = 1em
text-color = "#080800"
error-color = "#F8F8F0"
background-image = "${ldmcfg.background}"
background-color = "#1B1D1E"
window-color = "#F92672"
border-color = "#080800"
border-width = 2px
layout-space = 15
password-color = "#F8F8F0"
password-background-color = "#1B1D1E"
${cfg.extraConfig}
'';
in
{
options = {
services.xserver.displayManager.lightdm.greeters.mini = {
enable = mkOption {
type = types.bool;
default = false;
description = ''
Whether to enable lightdm-mini-greeter as the lightdm greeter.
Note that this greeter starts only the default X session.
You can configure the default X session by
<option>services.xserver.desktopManager.default</option> and
<option>services.xserver.windowManager.default</option>.
'';
};
user = mkOption {
type = types.str;
default = "root";
description = ''
The user to login as.
'';
};
extraConfig = mkOption {
type = types.lines;
default = "";
description = ''
Extra configuration that should be put in the lightdm-mini-greeter.conf
configuration file.
'';
};
};
};
config = mkIf (ldmcfg.enable && cfg.enable) {
services.xserver.displayManager.lightdm.greeters.gtk.enable = false;
services.xserver.displayManager.lightdm.greeter = mkDefault {
package = xgreeters;
name = "lightdm-mini-greeter";
};
environment.etc."lightdm/lightdm-mini-greeter.conf".source = miniGreeterConf;
};
}
|