summary refs log tree commit diff
path: root/mixins/greet.nix
blob: 5c46792201fed812a2b750577813c2fe90e000e1 (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
{
  pkgs,
  lib,
  ...
}: let
  user = "tzlil";

  users.users.greeter.packages = [pkgs.sway];
  greetd = "${pkgs.greetd.greetd}/bin/greetd";
  gtkgreet = "${pkgs.greetd.gtkgreet}/bin/gtkgreet";

  sway-kiosk = command: "${pkgs.sway}/bin/sway --unsupported-gpu --config ${pkgs.writeText "kiosk.config" ''
    output * bg #000000 solid_color
    exec "${command}; ${pkgs.sway}/bin/swaymsg exit"
  ''}";
in {
  environment.etc."greetd/environments".text =
    "sway\n"
    + "$SHELL -l\n";

  services.greetd = {
    enable = true;
    settings = {
      default_session = {
        inherit user;
        command = sway-kiosk "${gtkgreet} -l &>/dev/null";
      };
      initial_session = {
        inherit user;
        command = "sh -c sway";
      };
    };
  };
}