{ ... }:

{
  imports = [ ../common.nix ];

  networking.hostName = "iso-worker-01";

  boot.loader.grub = {
    enable = true;
    devices = [ "/dev/vda" ];
    efiSupport = true;
    efiInstallAsRemovable = true;
  };

  environment.etc."ultracloud-role".text = "worker\n";
  environment.etc."ultracloud-role-worker".text = "worker\n";
  environment.etc."ultracloud-canonical-install-path".text = "iso\n";

  services.nix-agent = {
    enable = true;
    chainfireEndpoint = "http://10.0.2.2:2379";
    clusterId = "baremetal-iso-canonical";
    nodeId = "iso-worker-01";
    flakeRoot = "/var/lib/photon-src";
    intervalSecs = 15;
    apply = true;
    healthCheckCommand = [
      "test"
      "-f"
      "/etc/ultracloud-role-worker"
    ];
  };

  systemd.services.nix-agent.environment.RUST_LOG = "info";
}
