{ pkgs, ... }:
{
  programs.vscode = {
    enable = true;
    package = (
      pkgs.stdenvNoCC.mkDerivation {
        pname = "vscode";
        version = pkgs.vscode.version;
        dontUnpack = true;
        meta.mainProgram = "code";
        installPhase = ''
          mkdir -p $out/bin
          touch $out/bin/code
          chmod +x $out/bin/code
        '';
      }
    );
    enableUpdateCheck = false;
    userSettings = {
      "editor.fontFamily" = "FiraCode Nerd Font";
      "editor.fontSize" = 14;
      "editor.fontLigatures" = true;
      "git.autofetch" = true;
      "editor.minimap.renderCharacters" = false;
      "editor.renderLineHighlight" = "gutter";
      "files.associations" = {
        ".clangd" = "yaml";
      };
      "files.autoSave" = "onFocusChange";
      "workbench.startupEditor" = "none";
      "window.restoreFullscreen" = true;
      "editor.smoothScrolling" = true;
      "extensions.ignoreRecommendations" = true;
      "jupyter.runStartupCommands" = [
        "%load_ext autoreload"
        "%autoreload 2"
      ];
      "notebook.lineNumbers" = "on";
      "editor.unicodeHighlight.nonBasicASCII" = false;
      "editor.unicodeHighlight.ambiguousCharacters" = false;
      "window.titleBarStyle" = "custom";
      "debug.onTaskErrors" = "abort";
      "explorer.confirmDelete" = false;
      "[python]" = {
        "editor.formatOnType" = true;
        "editor.defaultFormatter" = "ms-python.black-formatter";
      };
      "terminal.integrated.fontSize" = 13;
      "terminal.integrated.enableMultiLinePasteWarning" = "never";
      "editor.inlayHints.enabled" = "offUnlessPressed";
    };
    extensions = with pkgs.vscode-extensions; [
      llvm-vs-code-extensions.vscode-clangd
      github.copilot
      github.copilot-chat
      github.github-vscode-theme
      golang.go
      haskell.haskell

      nvarner.typst-lsp
      mgt19937.typst-preview
      (pkgs.vscode-utils.buildVscodeMarketplaceExtension {
        mktplcRef = {
          publisher = "OrangeX4";
          name = "vscode-typst-sympy-calculator";
          version = "0.5.1";
          sha256 = "sha256-/IfqMkyWxqH5NfOB5zKV3O8XUjnP30bOi86BnA4Ygi8=";
        };
      })

      ms-python.python
      ms-python.black-formatter
      ms-python.vscode-pylance
      ms-toolsai.jupyter
      ms-toolsai.vscode-jupyter-slideshow
      ms-toolsai.vscode-jupyter-cell-tags
      ms-toolsai.jupyter-renderers
      ms-toolsai.jupyter-keymap

      tamasfe.even-better-toml
      # vadimcn.vscode-lldb

      ziglang.vscode-zig
    ];
  };
}