{
  lib,
  pkgs,
  config,
  ...
}: let
  pkg = config.programs.vscode.package;
  menu = config.programs.menu.dmenuCommand;
  editorCmd = "NIXOS_OZONE_WL= ${pkg}/bin/${pkg.executableName}";
in {
  programs.vscode = {
    enable = true;
    package = lib.mkDefault pkgs.vscodium;
    extensions = [];
    userSettings = {
      "keyboard.dispatch" = "keyCode";
      "terminal.integrated.sendKeybindingsToShell" = true;
      "aws.telemetry" = false;
      "gitlens.telemetry.enabled" = false;
      "redhat.telemetry.enabled" = false;
      "cSpell.language" = "en,en-GB";
      "[typescript]" = {
        "editor.defaultFormatter" = "vscode.typescript-language-features";
      };
    };
  };

  programs.scripts = [
    {
      name = "open-code";
      text = ''
        code_dir=~/Documents/code
        cd $code_dir
        repo=$(ls | ${menu})
        [ -e "$repo" ] && ${editorCmd} $repo
      '';
      install = false;
      hotkeys = [{key = "C";}];
    }
  ];
}
