4 normaloHashedPassword = "$y$j9T$IEWqhKtWg.r.8fVkSEF56.$iKNxdMC6hOAQRp6eBtYvBk4c7BGpONXeZMqc8I/LM46";
7 services.userborn.enable = true;
8 users.mutableUsers = true;
14 name = "userborn-mutable-users";
16 meta.maintainers = with lib.maintainers; [ nikstur ];
28 hashedPassword = normaloHashedPassword;
33 specialisation.new-generation = {
34 inheritParentConfig = false;
37 inherit (config.nixpkgs) hostPlatform;
51 machine.wait_for_unit("userborn.service")
53 with subtest("normalo user is created"):
54 assert 1000 == int(machine.succeed("id --user normalo")), "normalo user doesn't have UID 1000"
55 assert "${normaloHashedPassword}" in machine.succeed("getent shadow normalo"), "normalo user password is not correct"
57 with subtest("Add new user manually"):
58 machine.succeed("useradd manual-normalo")
59 assert 1001 == int(machine.succeed("id --user manual-normalo")), "manual-normalo user doesn't have UID 1001"
61 with subtest("Delete manual--normalo user manually"):
62 machine.succeed("userdel manual-normalo")
65 machine.succeed("/run/current-system/specialisation/new-generation/bin/switch-to-configuration switch")
68 with subtest("normalo user is disabled"):
69 print(machine.succeed("getent shadow normalo"))
70 assert "!*" in machine.succeed("getent shadow normalo"), "normalo user is not disabled"
72 with subtest("new-normalo user is created after switching to new generation"):
73 print(machine.succeed("getent passwd new-normalo"))
74 assert 1001 == int(machine.succeed("id --user new-normalo")), "new-normalo user doesn't have UID 1001"