1 import ./make-test-python.nix (
4 name = "systemd-userdbd";
8 services.userdbd.enable = true;
10 users.users.test-user-nss = {
14 environment.etc."userdb/test-user-dropin.user".text = builtins.toJSON {
15 userName = "test-user-dropin";
18 environment.systemPackages = with pkgs; [ libvarlink ];
22 from shlex import quote
24 def getUserRecord(name):
25 Interface = "unix:/run/systemd/userdb/io.systemd.Multiplexer/io.systemd.UserDatabase"
26 payload = json.dumps({
27 "service": "io.systemd.Multiplexer",
30 return json.loads(machine.succeed(f"varlink call {Interface}.GetUserRecord {quote(payload)}"))
32 machine.wait_for_unit("systemd-userdbd.socket")
33 getUserRecord("test-user-nss")
34 getUserRecord("test-user-dropin")