{ config, lib, pkgs, ... }:

{
  imports = [
    ../cluster.nix
    ./disko.nix
  ];

  networking.hostName = "node01";
  networking.useDHCP = lib.mkDefault true;
  boot.loader.grub = {
    enable = true;
    devices = [ "/dev/vda" ];
    efiSupport = true;
    efiInstallAsRemovable = true;
  };

  services.chainfire = {
    enable = true;
    nodeId = "node01";
    apiAddr = "192.168.100.11:2379";
    raftAddr = "192.168.100.11:2380";
  };

  services.flaredb = {
    enable = true;
    nodeId = "node01";
    apiAddr = "192.168.100.11:2479";
    raftAddr = "192.168.100.11:2480";
  };

  services.iam = {
    enable = true;
    port = 50080;
    chainfireAddr = "192.168.100.11:2379,192.168.100.12:2379,192.168.100.13:2379";
    flaredbAddr = "192.168.100.11:2479,192.168.100.12:2479,192.168.100.13:2479";
  };

  services.openssh.enable = true;
  users.users.root.openssh.authorizedKeys.keys = [ ];

  system.stateVersion = "24.05";
}
