{
  self,
  hostPkgs,
  config,
  inputs,
  lib,
  ...
}:
{
  name = "service-phonebox";
  result.update-vars =
    let
      relativeDir = lib.removePrefix "${self}/" (toString config.clan.directory);
    in
    hostPkgs.writeShellScriptBin "update-vars" ''
      set -x
      export PRJ_ROOT=$(git rev-parse --show-toplevel)
      ${
        self.inputs.clan-core.packages.${hostPkgs.system}.clan-cli
      }/bin/clan-generate-test-vars $PRJ_ROOT/${relativeDir} ${config.name}
    '';

  clan = {
    directory = ./.;
    inventory = {
      machines.server = { };

      instances = {
        yggdrasil = {
          module.name = "yggdrasil";
          roles.default.machines.server = { };
        };
        phonebox-test = {
          module.name = "@clan/phonebox";
          module.input = "self";
          roles.default.machines."server".settings = {
            ata-ethernet-iface = "enp2s0";
          };
        };
      };
    };
  };

  nodes = {
    server = {
      services.asterisk = {
      };
    };
  };

  testScript = ''
    start_all()

    server.wait_for_unit("asterisk")

    server.succeed("systemctl status asterisk")

  '';
}
