at master 803 B view raw
1{ pkgs, ... }: 2{ 3 4 name = "jotta-cli"; 5 meta.maintainers = with pkgs.lib.maintainers; [ evenbrenden ]; 6 7 nodes.machine = 8 { pkgs, ... }: 9 { 10 services.jotta-cli.enable = true; 11 imports = [ ./common/user-account.nix ]; 12 }; 13 14 testScript = 15 { nodes, ... }: 16 let 17 uid = toString nodes.machine.users.users.alice.uid; 18 in 19 '' 20 machine.start() 21 22 machine.succeed("loginctl enable-linger alice") 23 machine.wait_for_unit("user@${uid}.service") 24 25 machine.wait_for_unit("jottad.service", "alice") 26 machine.wait_for_open_unix_socket("/run/user/${uid}/jottad/jottad.socket") 27 28 # "jotta-cli version" should fail if jotta-cli cannot connect to jottad 29 machine.succeed('XDG_RUNTIME_DIR=/run/user/${uid} su alice -c "jotta-cli version"') 30 ''; 31}