{
  lib,
  config,
  pkgs,
  ...
}:
let
  inherit (lib) mkIf;
  cfg = config.programs.vscode;
in
{
  config = mkIf cfg.enable {
    programs.vscode = {
      package = pkgs.vscode;
      enableUpdateCheck = false;
      extensions = with pkgs.vscode-extensions; [
        rust-lang.rust-analyzer
        ms-vscode-remote.remote-ssh
        ms-vscode-remote.remote-ssh-edit
        tamasfe.even-better-toml
      ];
      userSettings = {
        editor.formatOnSave = true;
        terminal.integrated.inheritEnv = false;
        git.autofetch = true;
        remote.SSH = {
          connectTimeout = 60;
          useLocalServer = true;
          remotePlatform = {
            "192.168.122.152" = "linux";
          };
        };
      };
    };
  };
}
