summaryrefslogtreecommitdiff
path: root/modules/desktops/ly.nix
blob: 6cde7f59eb28e43034c29df626c83c6e784acfe2 (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
{
  lib,
  config,
  pkgs,
  ...
}: let
  inherit (lib) mkIf;
  cfg = config.desktops;
in {
  config = mkIf cfg.ly {

    # display manager
    services.displayManager.ly = {
      enable = true;
      settings = let
        base = "0x00${config.theme.colors.base}";
        text = "0x00${config.theme.colors.text}";
        error = "0x00${config.theme.colors.error}";
        save_file = pkgs.writeText "ly-prefs" ''
          ${config.user}
          0
        '';
      in {
        # general
        clear_password = true;
        default_input = "password";
        numlock = true;
        hide_f1_commands = true;
        # state (evil)
        tty = 1;
        save = false;
        load = true;
        save_file = toString save_file;
        # background
        bg = base;
        error_bg = base;
        blank_box = false;
        # foreground
        fg = text;
        error_fg = error;
        border_fg = text;
      };
    };

    # disable default login on tty 1
    systemd.services."autovt@tty1".enable = false;
    systemd.services."getty@tty1".enable = false;

    # fix env not being set
    systemd.services.display-manager = {
      environment.XDG_CURRENT_DESKTOP = "X-NIXOS-SYSTEMD-AWARE";
    };
  };
}