1{
2 pkgs,
3 latestKernel ? false,
4 ...
5}:
6{
7 name = "greetd-no-shadow";
8 meta = with pkgs.lib.maintainers; {
9 maintainers = [ ];
10 };
11
12 nodes.machine =
13 { pkgs, lib, ... }:
14 {
15
16 users.users.alice = {
17 isNormalUser = true;
18 group = "alice";
19 password = "foobar";
20 };
21 users.groups.alice = { };
22
23 # This means login(1) breaks, so we must use greetd/agreety instead.
24 security.shadow.enable = false;
25
26 services.greetd = {
27 enable = true;
28 settings = {
29 default_session = {
30 command = "${pkgs.greetd}/bin/agreety --cmd bash";
31 };
32 };
33 };
34 };
35
36 testScript = ''
37 machine.start()
38
39 machine.wait_for_unit("multi-user.target")
40 machine.wait_until_succeeds("pgrep -f 'agretty.*tty1'")
41 machine.screenshot("postboot")
42
43 with subtest("Log in as alice on a virtual console"):
44 machine.wait_until_tty_matches("1", "login: ")
45 machine.send_chars("alice\n")
46 machine.wait_until_tty_matches("1", "login: alice")
47 machine.wait_until_succeeds("pgrep login")
48 machine.wait_until_tty_matches("1", "Password: ")
49 machine.send_chars("foobar\n")
50 machine.wait_until_succeeds("pgrep -u alice bash")
51 machine.send_chars("touch done\n")
52 machine.wait_for_file("/home/alice/done")
53 '';
54}