{
  inputs,
  config,
  self,
  ...
}:
{
  imports = [
    self.nixosModules.common

    (inputs.import-tree ./services)

    (import ../../lib/auto-accept-zerotier-members.nix {
      memberIds = [
        "dbe44c0287" # Alex-gateway
        "b0e0b84fd3" # Alex
        "2bd36db8cc" # kurogeek-thinkpad
      ];
    })
  ];

  clan.core.sops.defaultGroups = [ "admins" ];
  clan.core.networking.targetHost = "root@[${config.clan.core.vars.generators.zerotier.files.zerotier-ip.value}]";

  clan.core.settings.machine.description = "Glom NAS";

  nixpkgs.hostPlatform = {
    system = "x86_64-linux";
  };

  clan.core.vars.generators.vega-public-domain = {
    files.name.secret = false;

    prompts = {
      name = {
        persist = true;
        type = "line";
        description = "Base public domain for Vega machine. Default:(glomglom.fun)";
      };
    };

    script = ''cat $prompts/name || echo -n "glomglom.fun" > $out/name'';
  };

  clan.core.vars.generators.vega-internal-domain = {
    files.name.secret = false;

    prompts = {
      name = {
        persist = true;
        type = "line";
        description = "Base internal domain for Vega machine. Default:(glom.newedge.house)";
      };
    };

    script = ''cat $prompts/name || echo -n "glom.newedge.house" > $out/name'';
  };

  networking.fqdn = config.clan.core.vars.generators.vega-internal-domain.files.name.value;
  system.stateVersion = "25.11";

  # security.acme.defaults.email = "admin@b4l.co.th";
  # security.acme.acceptTerms = true;
  # services.nginx.virtualHosts."${config.networking.fqdn}" = {
  #   enableACME = true;
  # };
}
