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

let
  inherit (lib) mkDefault;
  inherit (lib.utils) isNotEmptyStr;
in
{
  config = {
    assertions = [
      {
        assertion = isNotEmptyStr config.networking.domain;
        message = "synix/nixos/common: config.networking.domain cannot be empty.";
      }
      {
        assertion = isNotEmptyStr config.networking.hostName;
        message = "synix/nixos/common: config.networking.hostName cannot be empty.";
      }
    ];

    networking = {
      domain = mkDefault "${config.networking.hostName}.local";
      hostId = mkDefault "8425e349"; # same as NixOS install ISO and nixos-anywhere

      # NetworkManager
      useDHCP = false;
      networkmanager = {
        enable = true;
        plugins = with pkgs; [
          networkmanager-openconnect
          networkmanager-openvpn
        ];
      };
    };
  };
}
