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

  users.users.greeter.packages = [pkgs.sway];
  greet = "${pkgs.greetd.gtkgreet.out}/bin/gtkgreet -l -s ${pkgs.writeText "gtkgreet.css" "
window {
  background-image: url(\"${pkgs.fetchurl {
    url = "https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fget.wallhere.com%2Fphoto%2FSerial-Experiments-Lain-anime-1363057.jpg&f=1&nofb=1&ipt=ba4bec61767537f6da6f0298f40e6a8ff2a5f1dc0e075a40bf77ba3a98654e15&ipo=images";
    sha256 = "sha256-oFUfNBdodHP7p/tAlwttzsY2SIyfsEgya6sN2GXEGy8=";
  }}\");
  background-size: cover;
  background-position: center;
}

box#body {
  background-color: rgba(50, 50, 50, 0.5);
  border-radius: 10px;
  padding: 50px;
}
"}";

  kiosk = command: "${pkgs.cage.out}/bin/cage -- ${command}";
in {
  options.greeter.initialSession = lib.mkOption {
    type = lib.types.str;
    default = "sh -c ${pkgs.sway}/bin/sway";
  };

  config = {
    environment.etc."greetd/environments".text =
      "sway\n"
      + "$SHELL -l\n";

    services.greetd = {
      enable = true;
      settings = {
        default_session = {
          inherit user;
          command = kiosk "${greet} -l &>/dev/null";
        };
        # initial_session = {
        #   inherit user;
        #   command = config.greeter.initialSession;
        # };
      };
    };
  };
}