{ pkgs, modulesPath, lib, config, ... }: let
    system = pkgs.system;

    #vmIp      = "5.180.46.39";
    vmIp      = "5.180.46.57";
    vmGateway = "5.180.46.1";
  in {
    imports = [ ];

    networking.useDHCP = false;
    networking.interfaces.ens3 = {
      ipv4.addresses = [
        { address = vmIp; prefixLength = 24; }
      ];
    };
    networking.defaultGateway = vmGateway;
    networking.nameservers = [ "1.1.1.1" "8.8.8.8" ];

    boot.loader.grub.device =  "/dev/vda";
    boot.initrd.availableKernelModules = [
      "ata_piix"
      "uhci_hcd"
      "xen_blkfront"
    ] ++ (if pkgs.system != "aarch64-linux" then [ "vmw_pvscsi" ] else []);
    fileSystems."/" = {
      device = "/dev/vda1";
      fsType = "ext4";
    };

    programs.git = { enable = true; };

    services.openssh = {
      enable = true;
      settings = {
        PasswordAuthentication = false;
      };
    };

    environment.systemPackages = (with pkgs; [ 
      # for system instalation in case when neccesary
      parted

      curl
      jq
      htop-vim

      # tools
      ncdu
      curl
      rsync
      neovim
      lsof
      openssl # maybe necessary for pg_smtp_client for postgresql
    ]);

    programs.zsh.enable = true;
    users.defaultUserShell = pkgs.zsh;

    # Enable flakes and new 'nix' command
    nix.settings.experimental-features = "nix-command flakes";

    # Autologin root in the VM
    services.getty.autologinUser = "root";

    users.users.root.openssh.authorizedKeys.keys = [
      ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICW5YVDdm/sN/Die9kGdGOpiGHnJUX4Aq5yCXALyWAwk devbox-user@devbox-vproxy''
      ''ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC5PxmNeqqxSREUcJy0qZi49ZROaefa5pwwnwGoe1UY8j/2hGRUlysVfp4ToleVR0eJnWuZ88aM31pyyhvZWUJpZpHW25m3QSxXyhFj15/Kk844ckJfeuB+0Di0LeN0LJynzHdz9Y/fNBXskRuhSrJ5MuzwEspM+Mc42wy++bAWWb3fFw+6N2Mj59RU82Cun9FZmecAd2oqk3OoYhtX4zfgxGhwsq+murxuLfFzQeBpIP/IsbTenuQc6sitEae+Lq6vrPV/TVazdV6o4tE7isa3TJoSdTF39n+gZffSZrSqSyMwBtbOvN42gB344JliJ1//wgDJWSJ1Oy4wz7F2Am+UwOWvPuvm75hXl7V9jXMECVRhZ+ROa6Q6//z7kdt6lfIrlh6zlPenFnv5ji/yyramYSxfbEEEBqPEjekh/OUSDdyuJ69Ektr8+pAAsX0hPhnXkmX7y8cY0dkmFZVUKPV2YDlKjL6d+Gq3LwdElPyR3a9j28Dkon/Ahv77VnKkqy1GawqfDdIyhmOW5dpNvHIYr0XhrBth8zyPvqpDfehtKevLLTTtl86aZ9nJFKavjfuo+By6OrwQPpsz4jFqoBdK7MNUZKw+d58a7Z+TlJpJwB5hjWpOuiPM5FQ0XP4WsLnKbEMYkw1KqtJMRt4rsOmcRcEwk3Oud1qMpG4a6FTLDQ== qq@archlinux''
      ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMezFt0OjCXCEjuOch03oTGXxgON+O9YShrU0hC0dJfb''
      ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICrbBG+U07f7OKvOxYIGYCaNvyozzxQF+I9Fb5TYZErK''
      ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGUqLmQXXcgpdv89UkDmctj5XmCBKMByQsFrEqBCfB1O''
      ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBsYIQVwnVi/zoqHvuXNXb9qcGsv9q3rY7z7gHmLPfI4''
    ];

    networking.firewall = {
      enable = true;
      allowedTCPPorts = [
        # for server
        443    # default ssl
        80
        4000
        #465    # SMTP over SSL
        #587    # SMTP over TLS (optional)
        #25     # Default SMTP (optional)
        53     # DNS
      ];
    };

  system.stateVersion = lib.mkForce "24.05";
}
