1{
2 config,
3 lib,
4 pkgs,
5 ...
6}:
7
8let
9 cfg = config.services.xserver.displayManager.sx;
10
11in
12{
13 options = {
14 services.xserver.displayManager.sx = {
15 enable = lib.mkEnableOption "" // {
16 description = ''
17 Whether to enable the "sx" pseudo-display manager, which allows users
18 to start manually via the "sx" command from a vt shell. The X server
19 runs under the user's id, not as root. The user must provide a
20 ~/.config/sx/sxrc file containing session startup commands, see
21 {manpage}`sx(1)`. This is not automatically generated from the desktopManager
22 and windowManager settings. sx doesn't have a way to directly set
23 X server flags, but it can be done by overriding its xorgserver
24 dependency.
25 '';
26 };
27
28 addAsSession = lib.mkEnableOption "" // {
29 description = ''
30 Whether to add sx as a display manager session. Keep in mind that sx
31 expects to be run from a TTY, so it may not work in your display
32 manager.
33 '';
34 };
35
36 package = lib.mkPackageOption pkgs "sx" { };
37 };
38 };
39
40 config = lib.mkIf cfg.enable {
41 environment.systemPackages = [ cfg.package ];
42
43 services = {
44 displayManager.sessionPackages = lib.optionals cfg.addAsSession [ cfg.package ];
45
46 xserver = {
47 exportConfiguration = true;
48 logFile = lib.mkDefault null;
49 };
50 };
51 };
52
53 meta.maintainers = with lib.maintainers; [
54 figsoda
55 thiagokokada
56 ];
57}